Fix password update None handling. (#1275)

This commit is contained in:
Mike Fotinakis
2023-08-26 04:14:26 -04:00
committed by GitHub
parent 830898c5bf
commit 0bf4e218f0
3 changed files with 39 additions and 1 deletions

View File

@@ -672,7 +672,7 @@ class BaseUserManager(Generic[models.UP, models.ID]):
except exceptions.UserNotExists:
validated_update_dict["email"] = value
validated_update_dict["is_verified"] = False
elif field == "password":
elif field == "password" and value is not None:
await self.validate_password(value, user)
validated_update_dict["hashed_password"] = self.password_helper.hash(
value