Skip to content

Commit

Permalink
raise 500
Browse files Browse the repository at this point in the history
  • Loading branch information
ychiucco committed Sep 19, 2024
1 parent 4c49ad1 commit a12d084
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fractal_server/app/routes/auth/_aux_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,17 @@ async def _user_or_404(user_id: int, db: AsyncSession) -> UserOAuth:
return user


async def _user_settings_or_404(user_id: int, db: AsyncSession):
async def _user_settings_or_404(
user_id: int, db: AsyncSession
) -> UserSettings:

user = await _user_or_404(user_id=user_id, db=db)
user_settings = await db.get(UserSettings, user.user_settings_id)

if user_settings is None:
raise HTTPException(

Check notice on line 125 in fractal_server/app/routes/auth/_aux_auth.py

View workflow job for this annotation

GitHub Actions / Coverage

Missing coverage

Missing coverage on line 125
status_code=status.HTTP_404_NOT_FOUND,
detail=f"Settings for User {user_id} not found.",
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail=f"User {user_id} has no UserSettings.",
)

return user_settings

0 comments on commit a12d084

Please sign in to comment.