Skip to content

UNIQUE constraint failed: auth_user.email #1152

Description

@chopwoodwater

I am having this wired error after the integration with django-allauth successfully running for several days. The email is used here as unique identifier of user instead of the user_name

IntegrityError at /accounts/signup/
UNIQUE constraint failed: auth_user.email
Request Method: POST
Request URL: http://localhost:8080/accounts/signup/
Django Version: 1.8
Exception Type: IntegrityError
Exception Value:
UNIQUE constraint failed: auth_user.email
Exception Location: /web_dev/unicorn_dev/lib/python3.4/site-packages/django/db/backends/sqlite3/base.py in execute, line 318
Python Executable: /web_dev/unicorn_dev/bin/python
Python Version: 3.4.3
Python Path:
['
/web_dev/unicorn_dev/funding',
'/Library/Frameworks/Python.framework/Versions/3.4/lib/python34.zip',
'/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4',
'/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/plat-darwin',
'/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload',
'
/web_dev/unicorn_dev/lib/python3.4/site-packages']

Here is the Model class:

class AccountUser(AbstractBaseUser, PermissionsMixin):
email = models.EmailField(('email address'), blank=False, max_length=255, unique=True)
first_name = models.CharField(
('first name'), max_length=40, blank=True, null=True, unique=False)
last_name = models.CharField(_('last name'), max_length=40, blank=True, null=True, unique=False)

Here is the settings.py
ACCOUNT_USER_MODEL_USERNAME_FIELD = None /* user_name is not used, if not None, migration will report errors */
ACCOUNT_USERNAME_REQUIRED = False

Enforce uniqueness of e-mail addresses.

ACCOUNT_USER_MODEL_EMAIL_FIELD = "email"
ACCOUNT_UNIQUE_EMAIL = True
ACCOUNT_AUTHENTICATION_METHOD = "email"

Could anyone please help?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions