Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down