Skip to content

Commit

Permalink
hotfix: retrieve id and username directly instead of using .get
Browse files Browse the repository at this point in the history
  • Loading branch information
sujanadh committed Jan 26, 2024
1 parent c8ed194 commit eb05106
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend/app/auth/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

async def get_uid(user_data: AuthUser) -> int:
"""Extract user id from returned OSM user."""
if user_id := user_data.get("id"):
if user_id := user_data.id:
return user_id
else:
log.error(f"Failed to get user id from auth object: {user_data}")
Expand Down Expand Up @@ -69,7 +69,7 @@ async def super_admin(

if not super_admin:
log.error(
f"User {user_data.get('username')} requested an admin endpoint, "
f"User {user_data.username} requested an admin endpoint, "
"but is not admin"
)
raise HTTPException(
Expand Down

0 comments on commit eb05106

Please sign in to comment.