added functional groups api + started pictures

This commit is contained in:
2025-07-30 19:10:10 +03:00
parent c203a890dc
commit 3341d68c7e
20 changed files with 1103 additions and 120 deletions

View File

@ -55,7 +55,7 @@ def check_user_existence(
""",
(username,),
)
return cur.fetchone()
return cur.fetchone()[0] # type: ignore
def check_user_disabled(
conn: connection,
@ -70,7 +70,10 @@ def check_user_disabled(
""",
(username,),
)
return cur.fetchone()
result = cur.fetchone()
if result is None:
return None
return result[0] # type: ignore
# user updates
@ -91,6 +94,7 @@ def update_user_disabled(
(disabled, username),
)
conn.commit()
return cur.rowcount > 0
def update_user_role(
conn: connection,
@ -107,6 +111,7 @@ def update_user_role(
(role, username),
)
conn.commit()
return cur.rowcount > 0
def update_user_username(
@ -124,6 +129,7 @@ def update_user_username(
(newUsername, username),
)
conn.commit()
return cur.rowcount > 0
def update_user_password(
conn: connection,
@ -140,6 +146,7 @@ def update_user_password(
(password, username),
)
conn.commit()
return cur.rowcount > 0
def update_user_last_seen(
@ -156,6 +163,7 @@ def update_user_last_seen(
(username,),
)
conn.commit()
return cur.rowcount > 0
# user receiving
@ -190,4 +198,7 @@ def get_user_password(
""",
(username,),
)
return cur.fetchone()[0] # type: ignore
result = cur.fetchone()
if result is None:
return None
return result[0] # type: ignore