start: rewrite the database layer using a freaking ORM

+ start ditching in-mem stores
+ move main db table to a new name
+ experiments!
This commit is contained in:
cwilvx
2024-06-24 00:26:47 +03:00
parent c3472a865a
commit c42ec4dcde
27 changed files with 1399 additions and 397 deletions
+13
View File
@@ -1,6 +1,8 @@
import hmac
import hashlib
from flask_jwt_extended import current_user
from app.config import UserConfig
@@ -29,3 +31,14 @@ def check_password(password: str, hashed: str) -> bool:
"""
return hmac.compare_digest(hash_password(password), hashed)
def get_current_userid() -> int:
"""
Get the current session user.
"""
try:
return current_user["id"]
except RuntimeError:
# Catch this error raised during migration execution
return 1