-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This was already planned because of the issues with UserCreationForm hard-coding the default Django user model, but as of Django 5.1.0 (which inadvertently added an admin-only field to the form) it's a bit more urgent to switch away. This commit makes the following major changes: * Introduces a pair of new base form classes -- one extremely minimal base class and a new default RegistrationForm derived from it -- which serve as the base registration form classes. * Enforces case-insensitive uniqueness of username on RegistrationForm. As of Django 4.2, UserCreationForm enforces case-insensitive username uniqueness by default, which means django-registration can finally enforce it by default as well. As a side effect, this deprecates RegistrationFormCaseInsensitive, because it existed solely to add the case-insensitive uniqueness validator on the username. The new base form classes derive much of their field-inclusion logic from the standard EMAIL_FIELD, USERNAME_FIELD, and REQUIRED_FIELDS attributes of user model classe, greatly simplifying custom-user support. The largest potentially-confusing situation is when a custom user model uses the email address as the "username"; the solution for that case to set EMAIL_FIELD and USERNAME_FIELD to the same value (mentioned in the documentation).
- Loading branch information
1 parent
7e5fd8d
commit 90ba1d8
Showing
12 changed files
with
505 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[flake8] | ||
extend-ignore = E203, E501, W503 | ||
extend-ignore = E203, E501, W503, B008 | ||
max-complexity = 13 | ||
max-line-length = 88 | ||
select = C,E,F,W,B,B950 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.