groups WIP

This commit is contained in:
2025-07-29 20:22:14 +03:00
parent 2ef27a9137
commit c203a890dc
9 changed files with 155 additions and 26 deletions

View File

@ -75,6 +75,40 @@ def check_user_disabled(
# user updates
def update_user_disabled(
conn: connection,
username: str,
disabled: bool
):
# if disabled = True => user is disabled
with conn.cursor() as cur:
cur.execute(
"""
update picrinth.users
set disabled = %s
where username = %s
""",
(disabled, username),
)
conn.commit()
def update_user_role(
conn: connection,
username: str,
role: str
):
with conn.cursor() as cur:
cur.execute(
"""
update picrinth.users
set role = %s
where username = %s
""",
(role, username),
)
conn.commit()
def update_user_username(
conn: connection,
username: str,
@ -108,24 +142,6 @@ def update_user_password(
conn.commit()
def update_user_disabled(
conn: connection,
username: str,
disabled: bool
):
# if disabled = True -> user is disabled
with conn.cursor() as cur:
cur.execute(
"""
update picrinth.users
set disabled = %s
where username = %s
""",
(disabled, username),
)
conn.commit()
def update_user_last_seen(
conn: connection,
username: str