🐛 fix(users.py): prevent non-superusers from changing their password
This commit is contained in:
parent
c3df875f1a
commit
3a4ae5e37b
1 changed files with 1 additions and 1 deletions
|
|
@ -99,7 +99,7 @@ def patch_user(
|
|||
raise HTTPException(
|
||||
status_code=403, detail="You don't have the permission to update this user"
|
||||
)
|
||||
if user_update.password:
|
||||
if user_update.password and not user.is_superuser:
|
||||
raise HTTPException(
|
||||
status_code=400, detail="You can't change your password here"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue