Skip to content

Commit

Permalink
replacing return HTTPException with raise (#134)
Browse files Browse the repository at this point in the history
Problem
Fastapi standard is to use raise instead of return

Solution
there was only one instance (that I could find) where we used return instead of raise

Ticket URL
https://mediform.atlassian.net/browse/MEDI-46

Documentation
NA

Tests Run
make testapi
  • Loading branch information
MadelaineJ authored Mar 18, 2024
1 parent 668c015 commit a4941a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/api/main/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def generate_auth_token(

def get_credentials_exception() -> HTTPException:

return HTTPException(
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Could not validate credentials",
headers={"WWW-Authenticate": "Bearer"},
Expand Down

0 comments on commit a4941a6

Please sign in to comment.