Skip to content

fix(BA-8671): clear need_password_change when a user changes their own password - #15979

Merged
fregataa merged 1 commit into
mainfrom
fix/BA-8671-self-password-clears-flag
Oct 22, 2026
Merged

fregataa merged 1 commit into
mainfrom
fix/BA-8671-self-password-clears-flag

Conversation

@fregataa

@fregataa fregataa commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

  • updateUserV2 (own account) now writes need_password_change=false along with a new password, the same as the auth password-change path. Before, only password_changed_at changed and the password-change banner stayed.
  • A request that sets a new password with needPasswordChange: true on updateUserV2 is rejected with UserModificationBadRequest.
  • adminUpdateUserV2 and REST v2 update_user keep the flag as it is.

Test plan

  • tests/component/user/test_update_user_v2.py
    • own password change clears the flag
    • own update without a password keeps the flag
    • admin password change of another user keeps the flag
    • own password change with needPasswordChange: true is rejected and nothing changes

Resolves BA-8671

🤖 Generated with Claude Code

@fregataa
fregataa requested a review from a team as a code owner October 22, 2026 01:20
Copilot AI balanced review requested due to automatic review settings October 22, 2026 01:20
@github-actions github-actions Bot added the size:L 100~500 LoC label Oct 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the comp:manager Related to Manager component label Oct 22, 2026
fregataa added a commit that referenced this pull request Oct 22, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fregataa
fregataa marked this pull request as draft October 22, 2026 01:34
raise UserModificationBadRequest(
"need_password_change cannot be true when changing your own password"
)
input = input.model_copy(update={"need_password_change": False})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need to be converted to false even if it's unset?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a purpose of this work

@fregataa
fregataa force-pushed the fix/BA-8671-self-password-clears-flag branch from 841f464 to e034e23 Compare October 22, 2026 01:52
@fregataa
fregataa marked this pull request as ready for review October 22, 2026 02:07
@fregataa
fregataa requested a review from a team October 22, 2026 02:08
@fregataa
fregataa marked this pull request as draft October 22, 2026 02:08
…n password

updateUserV2 now writes need_password_change=false along with a new
password, as the auth password-change path does, and rejects a request
that sets a new password with needPasswordChange=true. The rule lives in
the resolver next to the self-editable field check; adminUpdateUserV2
keeps the flag as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fregataa
fregataa force-pushed the fix/BA-8671-self-password-clears-flag branch from e034e23 to 88bcf5d Compare October 22, 2026 02:16
@github-actions github-actions Bot added size:XL 500~ LoC and removed size:L 100~500 LoC labels Oct 22, 2026
@fregataa
fregataa marked this pull request as ready for review October 22, 2026 02:26
@fregataa
fregataa merged commit 6c4973b into main Oct 22, 2026
45 checks passed
@fregataa
fregataa deleted the fix/BA-8671-self-password-clears-flag branch October 22, 2026 02:56
@github-actions

Copy link
Copy Markdown
Contributor

The backport to 26.9 hit conflicts: #15981 was created with the conflict markers committed in:

src/ai/backend/manager/api/adapters/user/report.md
tests/scenario/bai_scenario/components/domain.py
tests/scenario/bai_scenario/manager/user/test_editing.py

CI on it fails until the markers are resolved; check out its branch, fix, push, and merge it by hand (auto-merge is not enabled for conflicted backports).

@github-actions

Copy link
Copy Markdown
Contributor

The backport to 26.4 hit conflicts: #15982 was created with the conflict markers committed in:

src/ai/backend/manager/api/adapters/user/KNOWLEDGE.md
src/ai/backend/manager/api/adapters/user/report.md
src/ai/backend/manager/api/gql/user/resolver/mutation.py
tests/scenario/bai_scenario/components/domain.py
tests/scenario/bai_scenario/manager/user/test_editing.py
tests/scenario/bai_scenario/seeds/user/user.py
tests/unit/manager/api/gql/user/test_update_user_v2.py

CI on it fails until the markers are resolved; check out its branch, fix, push, and merge it by hand (auto-merge is not enabled for conflicted backports).

fregataa added a commit that referenced this pull request Oct 22, 2026
…n password (#15979) (#15981)

Co-authored-by: Sanghun Lee <sanghun@lablup.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
fregataa added a commit that referenced this pull request Oct 22, 2026
…n password (#15979) (#15982)

Co-authored-by: Sanghun Lee <sanghun@lablup.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@fregataa fregataa mentioned this pull request Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:manager Related to Manager component size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants