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:
Elrond
2011-12-25 20:11:09 +01:00
parent 0c0ab32274
commit 479e8a833b
2 changed files with 1 additions and 2 deletions

View File

@@ -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