Initial commit
Build and Push Docker Image / build-and-push (push) Successful in 18s

This commit is contained in:
ciomek committed 2026-08-16 11:41:07 +02:00
commit 279b2a7e90
49 files changed
+2664

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
from sqlmodel import Session, select
from loon.web.db import engine
from loon.web.users.models import User
def choose_admin(username: str) -> None:
with Session(engine) as session:
user = session.exec(
select(User).where(User.internal_username == username)
).first()
if user is None:
print(f"No user named {username!r}.")
return
if user.admin:
print(f"{username} is already admin.")
return
user.admin = True
session.add(user)
session.commit()
print(f"Promoted {username} to admin.")