Opened 15 months ago

Closed 15 months ago

Last modified 15 months ago

#21735 closed Bug (duplicate)

username field uniqueness check should be optional

Reported by: cjerdonek Owned by: nobody
Component: Core (Management commands) Version: 1.6
Severity: Normal Keywords:
Cc: chris.jerdonek@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently, Django doesn't let you have a username field with unique=False. This limitation was imposed recently in issue #19822.

I think this 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 corresponding validation link. This is essentially what 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. Instead, with this process the unique index should be on a pair of columns to enforce the fact that each email address should be in the database only once -- when restricted to active user accounts.

Change History (3)

comment:1 Changed 15 months ago by cjerdonek

  • Cc chris.jerdonek@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 15 months ago by cjerdonek

I discovered that this is a duplicate of issue #19844.

Last edited 15 months ago by cjerdonek (previous) (diff)

comment:3 Changed 15 months ago by cjerdonek

  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top