#19844: Uniqueness validation of USERNAME_FIELD should be overridable. --------------------------------------+------------------------------------ Reporter: josh@… | Owner: nobody Type: Cleanup/optimization | Status: new Component: contrib.auth | Version: master Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 --------------------------------------+------------------------------------
Comment (by cjerdonek): I also think the limitation should be lifted. In my use case, email address is the username field, and I would like a user account to be considered active only after the signup has been validated via email. To handle this use case, it is natural to add the account info to the user table when someone tries to sign up, and then activate that row only when the user clicks the validation link in the corresponding email. This is essentially what [https://django- registration.readthedocs.org django-registration] does in its two-phase registration workflow, with minor variations. However, with this use case, there are edge cases where the same email address can exist unregistered in the database more than once. With the above process, the unique index should enforce the fact that each email address should be in the database only once, but when restricted to __active__ user accounts. This can be done, for example, by having a unique index on the pair of columns username and activation key (where the activation key is set to the empty string when the user is activated). -- Ticket URL: <https://code.djangoproject.com/ticket/19844#comment:6> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/078.1231377b91aea279aa74ce473952cfd6%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.