Michal skrev: > Hello, > I have problem with inserting duplicate rows into DB. > > There is registration form on my site. User fill email address together > with additional parameters (form definition: http://dpaste.com/19959/). > After POST it to the server, email is checked in form against DB. If > user with same email exists, form error is generated. > > If form is valid (ie. user doesn't exists) I make another test in the > view and then call my function for creating whole new account: > > f_email = form.cleaned_data['email'] > if User.objects.filter(email__exact=f_email).count() == 0: > create_account(form.cleaned_data) > > In the create_account I try to create new user like this: > > user = User.objects.create_user(username, form['email'], > form['password1']) > 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" > Nis
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---