Opened 19 years ago

Closed 18 years ago

Last modified 18 years ago

#722 closed defect (wontfix)

Allow for period '.' and hyphen '-' characters in usernames with an isUsername validator

Reported by: Ian@… Owned by: Adrian Holovaty
Component: Validators Version:
Severity: normal Keywords: username validation period hyphen
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently restricts usernames by not allowed a '.'.
Can we remove this restriction? as there are several companies out there why my login ID would be either
Ian.Holsman
or
I.Holsman
and I would prefer to use the same ID that I use on my intranet, rather than invent yet another ID for myself.

Thanks
Ian

Attachments (2)

username_re.patch (1.5 KB ) - added by ian@… 19 years ago.
patch to allow less restrictive usernames
username.patch (1.9 KB ) - added by david@… 18 years ago.
Updates patch to M-R.

Download all attachments as: .zip

Change History (6)

by ian@…, 19 years ago

Attachment: username_re.patch added

patch to allow less restrictive usernames

comment:1 by Adrian Holovaty, 19 years ago

Resolution: wontfix
Status: newclosed

Feel free to override auth.User using replaces_module to change the business logic for usernames.

comment:2 by real.human@…, 19 years ago

Component: Admin interfaceValidators
Keywords: username validation period hyphen added
Resolution: wontfix
Status: closedreopened
Summary: Allow for a period '.' in usernamesAllow for period '.' and hyphen '-' characters in usernames with an isUsername validator

i've been told that "replaces_module" is old functionality that has died and gone away, and i only found one reference to it in a comment in the django documentation.

that being the case and because periods and hyphens are fairly common in usernames in most systems i've used, i'm going to re-open this ticket and request that django.core.validators.isUsername be added and used in django.contrib.auth.models.User.

the patch supplied by the original poster has an error in the regular expression though, the unescaped period will match any character. i'd like to see at least letters, numbers, periods, hyphens, and underscores allowed in a username. any extras (such as @, included in the original patch) wouldn't hurt, but i don't think we need to allow emails as usernames since we already have an email field.

comment:3 by Adrian Holovaty, 18 years ago

Resolution: wontfix
Status: reopenedclosed

To work around this, you can use a different authentication backend -- see the http://www.djangoproject.com/documentation/authentication/#other-authentication-sources page. It's a bit of a hoop to jump through, but we can't please everybody with the default username validation.

by david@…, 18 years ago

Attachment: username.patch added

Updates patch to M-R.

comment:4 by david@…, 18 years ago

I'd just like to point out that it seems pretty counter-intuitive to have an isUsername validator, but use isAlphaNumeric to validate usernames. I think an additional auth backend is a pretty big hoop compared to this change.

Note: See TracTickets for help on using tickets.
Back to Top