Closed Bug 1013156 Opened 10 years ago Closed 6 years ago

Support user and first names longer than 30 characters

Categories

(MozReview Graveyard :: General, defect, P4)

Production
defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: glob, Unassigned)

Details

i logged in to reviewboard-dev.allizom.org to edit dylan's account.

even though i didn't touch the first-name field, hitting save resulted in the following error regarding the first-name field:

> Ensure this value has at most 30 characters (it has 31).
> Dylan William Hardison [:dylan]
The real problem here is that, in Django, the first name field is limited to 30 characters, and we store the entire real name field in it, since there's no easy way to determine how they should be split between first and last, and since the sum total is probably often longer than 60 characters owing to all the extra data often stored in Bugzilla real names (irc nick, pto notifications, etc.).

Django's username field is also limited to 30 characters, which is similarly problematic given that Bugzilla's usernames are email addresses, often with modifiers (e.g. longusername+bugzilla@long.domain.name), a few of which exceed 30 characters.

I have silently hacked reviewboard-dev's database to increase the length of these fields to 255 characters without telling Django about the change.  This generally works because no bounds checking is performed if you update a Django model instance directly; however, apparently the UI does perform this check even when the value is unchanged.  Regardless, we should fix this properly, since it currently requires a manual, post-install step that could easily be forgotten, and the results would be silently truncated user and first names.

There's a SO article about this (http://stackoverflow.com/questions/2610088/can-djangos-auth-user-username-be-varchar75-how-could-that-be-done), and I raised the topic on the reviewboard-dev list (https://groups.google.com/forum/#!topic/reviewboard-dev/h9hSblOOznY).

This is a soft blocker on deployment, since we can still just hack the database after installing, and it seems that making someone an admin via the UI works even though this error is thrown, but it would be very nice to have this fixed properly.
Blocks: 1021929
Summary: unable to edit users on reviewboard if their name is longer than 30 characters → Support user and first names longer than 30 characters
Assignee: nobody → dkl
Status: NEW → ASSIGNED
OS: Mac OS X → All
Hardware: x86 → All
I'm going to remove this as a blocker.  I really really want to fix this, since I hate changing the underlying db schema without changing django's schema, but it's pretty tricky.
No longer blocks: 1021929
Product: bugzilla.mozilla.org → Developer Services
Note that we are no longer using the email address as username in Review Board (see bug 1058786), but there's no guarantee that a Bugzilla :ircnick will always be below 30 chars; also, the fallback username (when there is no :ircnick or it already exists) could also be longer.

I've also neglected to put which fields should actually be modified into this bug. To wit, auth_user.username, auth_user.first_name, and auth_user.email fields all must be increased to 255 characters.

This continues to be tricky to solve.
Priority: -- → P2
Don't think dkl is actively working on it.
Assignee: dkl → nobody
Status: ASSIGNED → NEW
This is super hard to fix and doesn't really break anything in deployed instances.  We just need to make sure we document that the db must be updated manually after creation.
Priority: P2 → P3
We have too many P1s, so I'm spreading out the priorities.  P3 -> P4, P2 -> P3, and some portion of P1s will become P2.
Priority: P3 → P4
Product: Developer Services → MozReview
MozReview is now obsolete. Please use Phabricator instead. Closing this bug.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.