diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-06 15:54:14 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-06 15:54:14 +0530 |
commit | d3ab83d7d10a06697fa0b764d11166fcfbd16cc6 (patch) | |
tree | cc0419097cda43f24ee68182b54d38f1c6621b82 /app | |
parent | ba5d1d6db23692c5e2769cb5efba0693ea82c3d4 (diff) |
removed assertion
Diffstat (limited to 'app')
-rw-r--r-- | app/apis.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/apis.py b/app/apis.py index 69bf222..4cd0c7c 100644 --- a/app/apis.py +++ b/app/apis.py @@ -13,8 +13,6 @@ async def API_Version(): @app.get("/v1/user-details") async def API_User_Details(email: str): user = models.User.query.filter_by(email=email).first() - try: - assert user is not None - except AssertionError: - raise HTTPException(status_code=404, detail="User Not Found") + if user is None: + raise HTTPException(status_code=404,detail="User Not Found") return {"first_name": user.first_name, "last_name": user.last_name} |