diff --git a/app/api/auth.py b/app/api/auth.py index ad0f65f..1f34c33 100644 --- a/app/api/auth.py +++ b/app/api/auth.py @@ -76,9 +76,8 @@ async def create_profile( db: AsyncSession = Depends(get_db), ) -> UserProfile: # Check if any users exist; first user becomes admin automatically. - result = await db.execute(select(User)) - existing = result.scalars().all() - is_first_user = len(existing) == 0 + result = await db.execute(select(User.id).limit(1)) + is_first_user = result.scalar_one_or_none() is None user = User( id=str(uuid.uuid4()),