Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

changed user register

  • Loading branch information...
commit 430a34af35b5b391656b68fbf78d1e1aff38a9cd 1 parent 1c3c977
@ceberhardt ceberhardt authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 emailauth/views.py
View
8 emailauth/views.py
@@ -25,6 +25,7 @@
from emailauth.utils import (use_single_email, requires_single_email_mode,
requires_multi_emails_mode, email_verification_days)
+from uuid import uuid4
def login(request, template_name='emailauth/login.html',
@@ -94,7 +95,7 @@ def account(request, template_name=None):
unverified_emails = UserEmail.objects.filter(user=request.user,
default=False, verified=False)
- return render_to_response(template_name,
+ return render_to_response(template_name,
{
'extra_emails': extra_emails,
'unverified_emails': unverified_emails,
@@ -114,8 +115,7 @@ def default_register_callback(form, email):
user.is_active = False
user.email = email.email
user.set_password(data['password1'])
- user.save()
- user.username = ('id_%d_%s' % (user.id, user.email))[
+ user.username = ('%s' % (uuid4()))[
:get_max_length(User, 'username')]
user.save()
email.user = user
@@ -172,7 +172,7 @@ def verify(request, verification_key, template_name='emailauth/verify.html',
verification_key = verification_key.lower() # Normalize before trying anything with it.
email = UserEmail.objects.verify(verification_key)
-
+
if email is not None:
email.user.message_set.create(message=_('%s email confirmed.') % email.email)
Please sign in to comment.
Something went wrong with that request. Please try again.