From deb58020789b0bc5ebe93fab93b81e8d32321a8b Mon Sep 17 00:00:00 2001 From: Immortale Date: Sat, 30 Nov 2024 08:40:07 +0300 Subject: [PATCH] fix: incorrect status codes on the subscription page (#1463) * fix: incorrect status codes on the subscription page * removed unnecessary information about exceptions --- app/dependencies.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/dependencies.py b/app/dependencies.py index 0d9ce058a..72255f1a8 100644 --- a/app/dependencies.py +++ b/app/dependencies.py @@ -69,14 +69,14 @@ def get_validated_sub( ) -> UserResponse: sub = get_subscription_payload(token) if not sub: - raise HTTPException(status_code=204, detail="Invalid subscription token") + raise HTTPException(status_code=404, detail="Not Found") dbuser = crud.get_user(db, sub['username']) if not dbuser or dbuser.created_at > sub['created_at']: - raise HTTPException(status_code=204, detail="User not found or invalid creation date") + raise HTTPException(status_code=404, detail="Not Found") if dbuser.sub_revoked_at and dbuser.sub_revoked_at > sub['created_at']: - raise HTTPException(status_code=204, detail="Subscription has been revoked") + raise HTTPException(status_code=404, detail="Not Found") return dbuser