Fix startup gen
All checks were successful
Build and Publish / build_and_publish (push) Successful in 27s

This commit is contained in:
Nexus 2024-07-11 18:56:58 +01:00
parent 930bff7aa1
commit 05f39a0a9f
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -53,7 +53,7 @@ async def lifespan(_app: FastAPI):
generate_schemas=True,
add_exception_handlers=True,
):
if not await db.Account.all().count():
if not (await db.Account.get_or_none(username="admin")):
generated_password = secrets.token_hex(16)
_d = await db.Account.create(
username="admin",