#28608: UserCreationForm and UserChangeForm model using get_user_model
-------------------------------------+-------------------------------------
               Reporter:  RĂ´mulo     |          Owner:  nobody
  Collopy                            |
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:             |        Version:  master
  contrib.auth                       |       Keywords:  user, custom user,
               Severity:  Normal     |  auth
           Triage Stage:             |      Has patch:  1
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 {{{
 class UserChangeForm(forms.ModelForm):
     # ...
     class Meta:
         model = User
 }}}

 and

 {{{
 class UserCreationForm(forms.ModelForm):
     class Meta:
         model = User
 }}}

 could use `UserModel` instead of `User`. It is already defined in
 
https://github.com/django/django/blob/01c6a3e227b645e8dea97e9befecd23d1d3b8581/django/contrib/auth/forms.py#L20
 and is used in other forms of the same package.

 This would allow Django Registration and other packages that use these
 forms to work out of the box. And it would allow using them with no need
 to rewitte as specified at
 https://docs.djangoproject.com/en/1.11/topics/auth/customizing/#custom-
 users-and-the-built-in-auth-forms

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28608>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/056.cde72c930821705e47f1d875cd1a8ba0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to