Nis Jørgensen wrote:
>>
> What is the value of "username"? This is what gives you the problem, not
> "email", as indicated here:
>> IntegrityError: ERROR: duplicate key violates unique constraint
>> "auth_user_username_key"
Hello Nis,
thank you for your interest. Username is evaluated from email by this
function:
def create_username(email):
from utils.czech import slugify
username = slugify(email).replace('-', '_')
try:
u = User.objects.get(username__exact=username[:30])
username = u"%s_%s" % (username[:21],
User.objects.make_random_password(length=8))
except User.DoesNotExist:
username = username[:30]
return username
Regards
Michal
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---