From 05f39a0a9ffb815aece9cf8203db55414c909cfa Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Thu, 11 Jul 2024 18:56:58 +0100 Subject: [PATCH] Fix startup gen --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 4581a03..bd4a390 100644 --- a/src/main.py +++ b/src/main.py @@ -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",