Users now become unverified when email is changed (#783)

* Users now become unverified when email is changed

Occurs when updating user.email to a new value

* changed wording
This commit is contained in:
jakemanger
2021-11-07 17:04:06 +08:00
committed by GitHub
parent 981e02b738
commit 9eb49482c7
2 changed files with 16 additions and 0 deletions

View File

@@ -545,6 +545,7 @@ class BaseUserManager(Generic[models.UC, models.UD]):
raise UserAlreadyExists()
except UserNotExists:
user.email = value
user.is_verified = False
elif field == "password":
await self.validate_password(value, user)
hashed_password = get_password_hash(value)