#28415: Documentation for ASCIIUsernameValidator is not consistent
-----------------------------------------+------------------------
               Reporter:  dcollinsn      |          Owner:  nobody
                   Type:  Uncategorized  |         Status:  new
              Component:  Documentation  |        Version:  1.11
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  1
                  UI/UX:  0              |
-----------------------------------------+------------------------
 Hello,

 While investigating the current and historical validation rules for
 usernames in Django, I noticed the following inconsistency, which is
 visible on the following page:

 
https://docs.djangoproject.com/en/1.11/ref/contrib/auth/#django.contrib.auth.models.User.username_validator

 {{{
 username¶
 Required. 150 characters or fewer. Usernames may contain alphanumeric, _,
 @, +, . and - characters.
 }}}

 but

 {{{
 class validators.ASCIIUsernameValidator¶
 New in Django 1.10.
 A field validator allowing only ASCII letters, in addition to @, ., +, -,
 and _. The default validator for User.username on Python 2.

 class validators.UnicodeUsernameValidator¶
 New in Django 1.10.
 A field validator allowing Unicode letters, in addition to @, ., +, -, and
 _. The default validator for User.username on Python 3.
 }}}

 The documentation is inconsistent on whether ASCII numbers are allowed in
 usernames at all, and whether Unicode numbers are allowed in usernames
 when using the Unicode validator or Python 3.

 Further, in light of this, the following paragraph isn't clear:

 {{{
 Usernames and Unicode

 Django originally accepted only ASCII letters in usernames. Although it
 wasn’t a deliberate choice, Unicode characters have always been accepted
 when using Python 3. Django 1.10 officially added Unicode support in
 usernames, keeping the ASCII-only behavior on Python 2, with the option to
 customize the behavior using User.username_validator.
 }}}

 I believe that Django originally accepted only ASCII letters and
 **numbers** in usernames.

 Note that there is such a thing as a Unicode number: I suspect the Unicode
 validator accepts all letter and number classes - not just 0-9, but also
 characters like ६ (Devanagari 6), ೬ (Kannada 6), ¹ (superscript), but
 reading the documentation makes me doubt this.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28415>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.f9b522fb84361e4797fcf36c8be320a7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to