Skip to content

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 🤓 🙌

@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