add temporary access when database is empty

This commit is contained in:
Thomas Peetz
2026-02-10 08:36:43 +01:00
parent 69fb3c1e97
commit cc9d54f671
4 changed files with 19 additions and 9 deletions
+4
View File
@@ -8,3 +8,7 @@ from src.db.models.admin import Profile
def get_profile(username: AnyStr, db: Session) -> Optional[Profile]:
profile = db.query(Profile).filter(Profile.email == username).first()
return profile
def is_database_empty(db: Session) -> bool:
profiles = db.query(Profile).all()
return len(profiles) == 0