#24087: django.contrib.forms.UserCreationForm inheritence won't work
------------------------------+-------------------------------------
     Reporter:  sh4r3m4n      |      Owner:  nobody
         Type:  Bug           |     Status:  new
    Component:  contrib.auth  |    Version:  1.7
     Severity:  Normal        |   Keywords:  forms,auth,users,custom
 Triage Stage:  Unreviewed    |  Has patch:  1
Easy pickings:  0             |      UI/UX:  0
------------------------------+-------------------------------------
 If I create a custom User model based on AbstractUser, i should also
 create a custom user creation form, inheriting from
 django.contrib.forms.UserCreationForm and defining the custom model I
 created in the Meta subclass. This won't work properly because
 UserCreationForm always use auth.User model when cleaning the username
 instead of the one defined in Meta.
 This should be patched changing lines 101 and 102 of
 contrib/auth/forms.py, from this:
 101             User._default_manager.get(username=username)
 102         except User.DoesNotExist:
 To this
 101             self.Meta.model._default_manager.get(username=username)
 102         except self.Meta.model.DoesNotExist:

--
Ticket URL: <https://code.djangoproject.com/ticket/24087>
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/051.033a9a5adbb1ba3321b8b30f6c20cd17%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to