1712: Increase auth_user.username field size and allow '@' in user names

ric****@gmai***** (Google Code) (Is this you? Claim this profile.)
Feb. 20, 2011

What version are you running?
1.5 RC1

What's the URL of the page this enhancement relates to, if any?

Describe the enhancement and the motivation for it.
Allow '@' in user names and increase the size of auth_user.username column would allow email address to be used as user account names. Our LDAP server returns email addresses as principal names, which therefore will be used as account names. Since RB doesn't really allow '@' in account name, this kind of accounts can't be edited (granting permissions etc) in the admin dashboard. Also the varchar(30) size limit for user name holds a big problem for longer email address.

What operating system are you using? What browser?
RB server: Ubuntu 10.04 w/ lighttpd + postgresql
Client: Windows XP SP3 / Windows 7
Browser: Firefox 3.x / Chrome 5.x / IE 7/8

Please provide any additional information below.
#1 chipx86
Unfortunately, these are restrictions put in place by Django, and not something we have a lot of control over. At least, the name length. We could potentially do something about the '@', and I thought that was covered under another bug report already, but I'm not seeing it.
#2 ric****@gmai***** (Google Code) (Is this you? Claim this profile.)
A one byte patch to accounts/admin.py would fix the '@' issue:

--- accounts/admin.py   2010-07-06 13:09:40.000000000 +0800
+++ ../reviewboard-local/accounts/admin.py  2010-07-02 09:08:36.000000000 +0800
@@ -8,7 +8,7 @@
 from reviewboard.accounts.models import ReviewRequestVisit, Profile

-USERNAME_REGEX = r'^[-\w.]+$'
+USERNAME_REGEX = r'^[-\w.@]+$'
 USERNAME_HELP_TEXT = _("Required. 30 characters or fewer. Alphanumeric "
                        "characters only (letters, digits, underscores, and "
#3 chipx86
Fixed on release-1.5.x and master.
  • +Fixed
  • +Milestone-Release1.5.x
  • +chipx86