Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#26993 closed Cleanup/optimization (fixed)

Increase the length of the User model's last_name field to 150 characters

Reported by: Malcolm Box Owned by: Thom Wiggers
Component: contrib.auth Version: dev
Severity: Normal Keywords:
Cc: django@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Large parts of the world have names that can easily exceed the current 30 char limit - see discussion on Django-dev here: https://groups.google.com/forum/#!topic/django-developers/h98-oEi7z7g

Conclusion from discussion that extending the last_name field to somewhere between 60 and 255 would be reasonable.

Change History (11)

comment:1 by Tim Graham, 8 years ago

Easy pickings: unset
Triage Stage: UnreviewedSomeday/Maybe
Type: BugCleanup/optimization

Bumping to Someday/Maybe until there's a consensus about what length to use (hopefully that discussion won't go much longer).

comment:2 by Tim Graham, 8 years ago

Summary: Increase the length of the User model's last_name field to allow more of the world to use itIncrease the length of the User model's last_name field to 100 characters
Triage Stage: Someday/MaybeAccepted

Consensus on the mailing list suggests that 100 characters is sufficient.

comment:3 by Damian, 8 years ago

Owner: changed from nobody to Damian
Status: newassigned

comment:4 by Tim Graham, 8 years ago

This should include docs and a database migration as in 15ef1dd478c5b6f005e5f782b7619f718ed55e84. Also, the discussion continues about 100 vs. 150 characters.

comment:5 by Damian, 8 years ago

I rushed a little bit. I can see that. My mistake.

I was going to ask about the docs, whether to reference new commit to this one, or make it in the same one.

Will keep an eye on the discussion and update docs together with db migrations (if nescessary new models.py file)once the discussion reaches the consensus.

comment:6 by Thom Wiggers, 8 years ago

Cc: django@… added
Has patch: set
Owner: changed from Damian to Thom Wiggers

This came up in one of the applications I maintain and I thought I'd take a stab at fixing it.

A PR can be found here on Github: PR7923

comment:7 by Tim Graham, 8 years ago

Patch needs improvement: set

comment:8 by Thom Wiggers, 8 years ago

Patch needs improvement: unset
Summary: Increase the length of the User model's last_name field to 100 charactersIncrease the length of the User model's last_name field to 150 characters

I have incorporated Tim's feedback. Details are available on the PR. Tim also suggested going for 150 chars, that's fine by me (edited title accordingly).

I'm unsetting 'Patch needs improvement' as I think that should make it show up for review again in Trac.

comment:9 by Thom Wiggers, 8 years ago

As an aside: maybe it is a good idea to make this same change for first names. There's probably going to be someone who breaks the current limit, either with or without including middle names.

E.g. there's some guy named "James <all james bond films> Bond"* according to some clickbait site.

Maybe this is more something for another mailing list discussion to reach some concensus though: in that case it's probably more something for a new issue.

*I got hit by the spam filter.

Last edited 8 years ago by Thom Wiggers (previous) (diff)

comment:10 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In d5b573d:

Fixed #26993 -- Increased User.last_name max_length to 150 characters.

comment:11 by Ryan Petrello, 5 years ago

As an aside: maybe it is a good idea to make this same change for first names.

@Thom Wiggers

I maintain an open source project that uses Django, and we've had users asking for exactly that - they have international users with longer names in their LDAP systems, and the 30 character limit isn't good enough.

As such, I've filed a new ticket and opened a PR for anybody who's interested:

https://code.djangoproject.com/ticket/31371
https://github.com/django/django/pull/12581

Last edited 5 years ago by Ryan Petrello (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top