[email] Fix unsubscribe bug

This commit is contained in:
Cathy Hu 2020-09-11 23:33:37 +02:00
parent 906dba0c83
commit 7b8d17b77b

View file

@ -263,9 +263,9 @@ async def email_unsubscribe(token, hood=Depends(get_hood_unauthorized)):
await subscriber.delete()
return Response(status_code=status.HTTP_204_NO_CONTENT)
except NoMatch:
return HTTPException(status_code=status.HTTP_404_NOT_FOUND)
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND)
except exceptions.CryptoError:
return HTTPException(status_code=status.HTTP_400_BAD_REQUEST)
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST)
@router.get(