Add delete prepaid and show prepaid users

Shows only prepaid users which postpaid_id equals logged in id
an deletes only users whose money equals 0. Additionally a lot
of style improvements in base.html and new favicons which
actually load in.
This commit is contained in:
2025-05-19 17:49:29 +02:00
parent cd2b7ae14c
commit eec8f54eab
7 changed files with 253 additions and 542 deletions

View File

@@ -320,3 +320,12 @@ def set_prepaid_user_money(user_id: int, money: int, postpaid_user_id: int):
raise HTTPException(status_code=404, detail="User not found")
connection.commit()
return result.rowcount
def del_user_prepaid(user_id: int):
t = text("DELETE FROM users_prepaid WHERE id = :id")
with engine.connect() as connection:
result = connection.execute(t, {"id": user_id})
if result.rowcount == 0:
raise HTTPException(status_code=404, detail="User not found")
connection.commit()
return result.rowcount