Skip to content

🐛 Fix required password validation when editing user fields #1508

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

Merged
merged 1 commit into from
Feb 22, 2025

Conversation

jpizquierdo
Copy link
Contributor

Issue when editting the user fields, It was required that you mandatory put the password and the new password. If for example you just want to edit the user "is_active" you are enforced to put a new password.
In my use case I set the "is_active" to false when someone signs up, and I want to enable one per one the users without changhing their password.
I think that it is a bug because the empty password is already handled here:

  const onSubmit: SubmitHandler<UserUpdateForm> = async (data) => {
    if (data.password === "") {
      data.password = undefined
    }
    mutation.mutate(data)
  }

…ry put the password and the new password. If for example you just want to edit the user "is_active" you are enforced to put a new password.
@alejsdev alejsdev added the bug Something isn't working label Feb 22, 2025
@alejsdev alejsdev changed the title Issue when editting the user fields, mandatory password 🐛 Fix required password validation when editing user fields Feb 22, 2025
@alejsdev alejsdev merged commit c067292 into fastapi:master Feb 22, 2025
17 of 18 checks passed
@alejsdev
Copy link
Member

Yes, it was a bug, thanks for fixing it! @jpizquierdo 🤓 🙌

JBLangton pushed a commit to JBLangton/full-stack-fastapi-template that referenced this pull request Mar 29, 2025
@dvli20
Copy link

dvli20 commented Apr 17, 2025

Hello, I reproduced the bug.

bug_reproduction.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants