Giter VIP home page Giter VIP logo

Comments (3)

pennersr avatar pennersr commented on June 12, 2024

Django has the email field defined like this:

class AbstractUser(AbstractBaseUser, PermissionsMixin):
    email = models.EmailField(_("email address"), blank=True)

You deviate from that by doing:

    email = models.EmailField(_("email address"), blank=False, null=False, unique=True)

So, you're making it unique. When the user model has an email field allauth populates that, even if the email address is still unverified. Note that allauth allows for 2 different users to have the same email address, though only one user can have it listed as verified.

Given your user model definition, I think the only way around would be to not populate the email field for users unless it is truly verified. You could do that by setting ACCOUNT_USER_MODEL_EMAIL_FIELD to None -- then allauth won't do any attempt to populate the field. Then, you could use e.g. the email_confirmed signal to actually start populating the field.

Though, you can also ask yourself, why go against the flow, and why not just use Django's standard way of working? Or, perhaps remove the email field from the user altogether as it really is just denormalized data (of the EmailAddress model).

from django-allauth.

pennersr avatar pennersr commented on June 12, 2024

...my assumption would have been that this is intercepted.

As mentioned above, your email field deviates from what is standard in Django, and allauth has no knowledge about how you want to have that populated. So I don't really see how this can be intercepted. Just set ACCOUNT_USER_MODEL_EMAIL_FIELD = None.

from django-allauth.

Okan0 avatar Okan0 commented on June 12, 2024

Hi, thanks for the quick reply. I guess that will help :)

from django-allauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.