[Django] #29176: Cannot use a custom username field which is not a string

4 views
Skip to first unread message

Django

unread,
Mar 1, 2018, 9:44:45 AM3/1/18
to django-...@googlegroups.com
#29176: Cannot use a custom username field which is not a string
--------------------------------------------+------------------------
Reporter: Christophe Mehay | Owner: nobody
Type: Bug | Status: new
Component: contrib.auth | Version: 2.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------------+------------------------
I use phone_number module for my username field in Auth module and since I
migrated my project to django2, the classmethod normalize_username tries
to normalise data which are not a string.

A simple patch would be to check username type in this method and
normalize only if the type is a string.

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

Django

unread,
Mar 1, 2018, 1:40:35 PM3/1/18
to django-...@googlegroups.com
#29176: User.normalize_username() crashes if username isn't a string
----------------------------------+------------------------------------

Reporter: Christophe Mehay | Owner: nobody
Type: Bug | Status: new
Component: contrib.auth | Version: 2.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Changes (by Tim Graham):

* has_patch: 0 => 1
* stage: Unreviewed => Accepted
* needs_tests: 0 => 1


Comment:

[https://github.com/django/django/pull/9740 PR] (needs a test)

--
Ticket URL: <https://code.djangoproject.com/ticket/29176#comment:1>

Django

unread,
Mar 2, 2018, 12:14:27 PM3/2/18
to django-...@googlegroups.com
#29176: User.normalize_username() crashes if username isn't a string
----------------------------------+------------------------------------
Reporter: Christophe Mehay | Owner: nobody
Type: Bug | Status: closed
Component: contrib.auth | Version: 2.0
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"e91ff6e29cfd916afd3620adf4aeab733e06dbb5" e91ff6e]:
{{{
#!CommitTicketReference repository=""
revision="e91ff6e29cfd916afd3620adf4aeab733e06dbb5"
[2.0.x] Fixed #29176 -- Fixed AbstractBaseUser.normalize_username() crash
if username isn't a string.

Backport of 40bac28faabbacd0875e59455cd80fb1dbb16966 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29176#comment:3>

Django

unread,
Mar 2, 2018, 12:14:27 PM3/2/18
to django-...@googlegroups.com
#29176: User.normalize_username() crashes if username isn't a string
----------------------------------+------------------------------------
Reporter: Christophe Mehay | Owner: nobody
Type: Bug | Status: closed
Component: contrib.auth | Version: 2.0

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"40bac28faabbacd0875e59455cd80fb1dbb16966" 40bac28f]:
{{{
#!CommitTicketReference repository=""
revision="40bac28faabbacd0875e59455cd80fb1dbb16966"


Fixed #29176 -- Fixed AbstractBaseUser.normalize_username() crash if

username isn't a string.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29176#comment:2>

Reply all
Reply to author
Forward
0 new messages