fix permissions issue
All checks were successful
Build Docker / deploy (push) Successful in 49s
Build Docker / build (push) Successful in 57s

This commit is contained in:
2026-05-17 19:14:42 +03:00
parent 57c88ab44b
commit ca966f0bc6
3 changed files with 7 additions and 6 deletions

View File

@@ -31,7 +31,8 @@ async def update_user(data: pydantic.UserUpdate, user=Depends(get_current_user))
if not user_check:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="User not found")
if not user_check.admin:
if data.code != user_check.code:
print(data.code)
if data.code != user_check.code and data.code:
raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN,
detail="Ordinary users cannot change their code"