Verified Commit c5f49317 authored by Oliver Falk's avatar Oliver Falk
Browse files

Fix overwriting verification key upon sending confirmation mail

parent 334da918
Pipeline #2064 passed with stage
in 7 minutes and 30 seconds
......@@ -359,11 +359,12 @@ class UnconfirmedEmail(BaseAccountModel):
def save(self, force_insert=False, force_update=False, using=None,
update_fields=None):
hash_object = hashlib.new('sha256')
hash_object.update(
urandom(1024) + self.user.username.encode('utf-8') # pylint: disable=no-member
) # pylint: disable=no-member
self.verification_key = hash_object.hexdigest()
if not self.verification_key:
hash_object = hashlib.new('sha256')
hash_object.update(
urandom(1024) + self.user.username.encode('utf-8') # pylint: disable=no-member
) # pylint: disable=no-member
self.verification_key = hash_object.hexdigest()
super(UnconfirmedEmail, self).save(
force_insert,
force_update,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment