Skip to content

Closes #16964: Validate password when creating a new user or updating password for an existing user #16982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

nishant131
Copy link
Contributor

Fixes: #16964

  • Call validate_password() on the configured password validators, while cleaning the UserForm data.

…user or updating password for an existing user
@jeremystretch
Copy link
Member

Hi @nishant131, thanks for digging into this! In addition to the form validation, we also need to enforce the validation under the REST serializer for the User model.

I went ahead and did this (and added the relevant tests), but when I pushed my commit it ended up creating a new branch under the netbox repo. I'm not sure what happened. 😕

I've opened PR #16990, which includes your initial commit, to replace this. Sorry for the mix-up.

@nishant131
Copy link
Contributor Author

Hi @jeremystretch, I think the new branch got created on netbox repo as I had unchecked Allow edits by maintainers in the PR. Since, it was my first contribution to netbox, I wasn't sure whether to allow it or not 😕.
Maybe, we can add this in the PR submission guideline doc.

Thank you for adding the validation under the REST serializer, I'll incorporate that in my setup as well 🙂

@jeremystretch
Copy link
Member

I think the new branch got created on netbox repo as I had unchecked Allow edits by maintainers in the PR

That's my suspicion as well, however in the past GitHub has rejected the push in such cases. Maybe they've changed things. 🤷‍♂️

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configured password validators are not executing when creating a new user or changing the password for existing user
2 participants