#722 closed defect (wontfix)
Allow for period '.' and hyphen '-' characters in usernames with an isUsername validator
Reported by: | 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)
Change History (6)
by , 19 years ago
Attachment: | username_re.patch added |
---|
comment:1 by , 19 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Feel free to override auth.User using replaces_module
to change the business logic for usernames.
comment:2 by , 19 years ago
Component: | Admin interface → Validators |
---|---|
Keywords: | username validation period hyphen added |
Resolution: | wontfix |
Status: | closed → reopened |
Summary: | Allow for a period '.' in usernames → Allow 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 , 18 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
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.
comment:4 by , 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.
patch to allow less restrictive usernames