#32599: django.contrib.auth.forms.py should always refer to User as
get_user_model()
-----------------------------------------+-------------------------------
               Reporter:  Joe Michelini  |          Owner:  Joe Michelini
                   Type:  Uncategorized  |         Status:  assigned
              Component:  contrib.auth   |        Version:  3.1
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  1
                  UI/UX:  0              |
-----------------------------------------+-------------------------------
 == Inconsistent Reference

 In some sections of django.contrib.auth.forms.py, when referring to the
 User model, Django wisely uses get_user_model(), so whether we decide to
 use the built-in User model, extend it, or use our own, we always get the
 right user when importing these forms.

 However, in the UserCreationForm for example, Django instead explicitly
 refers to the built-in user found at django.contrib.auth.models.

 This causes some forms to work and some forms to fail when using a custom
 or extended User model, even though extending the built-in User model is
 suggested in the Django documentation.

 This is an easy fix and would require all forms in
 django.contrib.auth.forms to refer to get_user_model() as opposed to the
 imported built-in User. In the case where a custom User model is not being
 utilized, get_user_model() will automatically refer to the built-in User.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32599>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/056.0152276e97b8438e479fc8242f52616b%40djangoproject.com.

Reply via email to