auth-check-middleware
Some checks failed
deploy / deploy (push) Failing after 1m6s

This commit is contained in:
2023-12-17 14:42:04 +03:00
parent f061d8a523
commit 01d7935cbd
6 changed files with 49 additions and 16 deletions

View File

@@ -1,5 +1,6 @@
# from contextlib import contextmanager
from typing import Any, Callable, Dict, TypeVar
# from psycopg2.errors import UniqueViolation
from sqlalchemy import Column, Integer, create_engine
from sqlalchemy.ext.declarative import declarative_base
@@ -18,7 +19,7 @@ REGISTRY: Dict[str, type] = {}
# @contextmanager
def local_session(src=""):
return Session(bind=engine, expire_on_commit=False)
# try:
# yield session
# session.commit()
@@ -60,8 +61,8 @@ class Base(declarative_base()):
except Exception as e:
print(f"[services.db] Error dict: {e}")
return {}
def update(self, values: Dict[str, Any]) -> None:
for key, value in values.items():
if hasattr(self, key):
setattr(self, key, value)
for key, value in values.items():
if hasattr(self, key):
setattr(self, key, value)