#19284: django.contrib.auth.forms imports User instead of using get_user_model ---------------------------------+--------------------------------------- Reporter: kunitoki@… | Owner: nobody Type: Uncategorized | Status: closed Component: contrib.auth | Version: 1.5-alpha-1 Severity: Release blocker | Resolution: wontfix Keywords: auth user | Triage Stage: Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 ---------------------------------+--------------------------------------- Changes (by russellm):
* status: new => closed * resolution: => wontfix Comment: Just importing User shouldn't cause an error. You must be inadvertently using the User model in some way. The only forms using User are UserCreationForm and UserChangeForm, both of which are documented as needing to be over The patch form @akaariai won't work reliably, either -- because it assumes makes an assumption about the name and validation of the username field. This means the form will fail in interesting ways, depending on the User model you have in use. As an aside, the patch also make testing difficult, because the form is bound to the User model that is in use at the time the auth module is imported. It might be possible to make the Create and Change forms completely generic, but for my money, it just isn't worth the effort and complexity, given the effort required to fix in a subclass. There might be some opportunity for introducing a base class to make subclassing easier, but that's a topic for a separate ticket. tl;dr - that particular User import was deliberate, and shouldn't be causing problems. Marking wontfix on that basis. If someone can demonstrate the way to reproduce the described error, then feel free to reopen. -- Ticket URL: <https://code.djangoproject.com/ticket/19284#comment:2> 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 post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.