Move verification key generation to view
Instead of creating the email verication key on the db model as a default for the field, create it in the registration view. Now all verification key generation is only in auth/views.py!
This commit is contained in:
@@ -84,6 +84,7 @@ def register(request):
|
||||
user.email = email
|
||||
user.pw_hash = auth_lib.bcrypt_gen_password_hash(
|
||||
request.POST['password'])
|
||||
user.verification_key = unicode(uuid.uuid4())
|
||||
user.save(validate=True)
|
||||
|
||||
# log the user in
|
||||
|
||||
Reference in New Issue
Block a user