diff --git a/design_bot/routes/registration.py b/design_bot/routes/registration.py index eaaccc1..37dfdc3 100644 --- a/design_bot/routes/registration.py +++ b/design_bot/routes/registration.py @@ -41,7 +41,7 @@ async def sign_up(new_user: UserPost, _: auth.User = Depends(auth.get_current_us @registration.patch("/{social_web_id}", response_model=UserGet) async def patch_user(social_web_id: str, schema: UserPatch, _: auth.User = Depends(auth.get_current_user)) -> UserGet: user_query = db.session.query(User.social_web_id == social_web_id) - if not user_query.one_or_none(): + if not user_query.all(): raise HTTPException(status_code=404, detail="User not found") user_query.update(**schema.dict(exclude_unset=True)) db.session.flush()