Skip to content

Commit

Permalink
fix: password not updated when calling modify_user mutation (#1787)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyujin-cho authored Dec 15, 2023
1 parent 59067d4 commit 375b4f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/1787.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix `modify_user` mutation not working
2 changes: 2 additions & 0 deletions src/ai/backend/manager/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,8 @@ async def mutate(
set_if_set(props, data, "resource_policy")
set_if_set(props, data, "sudo_session_enabled")
set_if_set(props, data, "main_access_key")
if data.get("password") is None:
data.pop("password", None)
if not data and not props.group_ids:
return cls(ok=False, msg="nothing to update", user=None)
if data.get("status") is None and props.is_active is not None:
Expand Down

0 comments on commit 375b4f0

Please sign in to comment.