Skip to content
This repository has been archived by the owner on Mar 12, 2023. It is now read-only.

delete user endpoint #19

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion design_bot/routes/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down