#27515: Make AuthenticationForm use the username length from the user model
-------------------------------------+-------------------------------------
Reporter: Ramin Farajpour | Owner: Ramin
Cami | Farajpour Cami
Type: | Status: closed
Cleanup/optimization |
Component: contrib.auth | Version: 1.10
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):
* status: assigned => closed
* component: Forms => contrib.auth
* has_patch: 1 => 0
* resolution: => invalid
* stage: Unreviewed => Accepted
Comment:
[https://docs.djangoproject.com/en/stable/topics/auth/customizing/#specifying-a
-custom-user-model Custom user models] may have a username with length
other than 150, that's why using that value isn't appropriate. We might be
able to use that with something like this:
`self.fields['username'].max_length =
UserModel._meta.get_field(UserModel.USERNAME_FIELD).max_length`.
--
Ticket URL: <https://code.djangoproject.com/ticket/27515#comment:6>
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/065.ff2c7b2d9f693af8cc6bd8575944da4b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.