Fix inline validation errors on password update form#5315
Open
ajrbyers wants to merge 1 commit into
Open
Conversation
Wrap edit-profile password change in PasswordChangeForm so validation errors (current-password mismatch, confirmation mismatch, policy failures) render inline via the form errors partial and the page stays put on failure instead of redirecting with disappearing toasts. Adds the password_rules partial so requirements are visible upfront.
mauromsl
requested changes
May 27, 2026
| new_two = cleaned.get("new_password_two") | ||
|
|
||
| if new_one and new_two and new_one != new_two: | ||
| self.add_error("new_password_two", _("Passwords do not match.")) |
Member
There was a problem hiding this comment.
All we've done here is change the punctuation, it is worth updating the key on PO files
mauromsl
reviewed
May 27, 2026
Comment on lines
+291
to
+296
| if new_one and self.user and self.request: | ||
| problems = self.user.password_policy_check(self.request, new_one) | ||
| for problem in problems: | ||
| self.add_error("new_password_one", _("Password not updated: ") + str(problem)) | ||
|
|
||
| return cleaned |
Member
There was a problem hiding this comment.
we are adding the errors on the form inline, which is great, but we lost the messages / toastr prompt. Is it worth also displaying one?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4642