[Django] #19925: Models validator should check if UserModel.REQUIRED_FIELDS is list

3 views
Skip to first unread message

Django

unread,
Feb 27, 2013, 12:11:22 AM2/27/13
to django-...@googlegroups.com
#19925: Models validator should check if UserModel.REQUIRED_FIELDS is list
----------------------------------------------+--------------------
Reporter: RomanAlexander | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Database layer (models, ORM) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 1 | UI/UX: 0
----------------------------------------------+--------------------
[https://github.com/django/django/pull/862 Pull request with patch here.]

I spent some time debugging django-admin.py createsuperuser raising
optparse.OptionConflictError.
I forgot to make REQUIRED_FIELDS custom user model a list. This validation
error should help others avoid my mistake.

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

Django

unread,
Mar 1, 2013, 12:21:45 PM3/1/13
to django-...@googlegroups.com
#19925: Models validator should check if UserModel.REQUIRED_FIELDS is list
-------------------------------------+-------------------------------------
Reporter: RomanAlexander | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by apollo13):

* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0


Comment:

Sounds like a sensible addition.

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

Django

unread,
Mar 3, 2013, 12:58:05 AM3/3/13
to django-...@googlegroups.com
#19925: Models validator should check if UserModel.REQUIRED_FIELDS is list
-------------------------------------+-------------------------------------
Reporter: RomanAlexander | Owner: nobody

Type: | Status: new
Cleanup/optimization | Version: master
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by streeter):

* cc: django@… (added)


Comment:

I created the pull request https://github.com/django/django/pull/876 to
fix this.

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

Django

unread,
Mar 3, 2013, 1:00:48 AM3/3/13
to django-...@googlegroups.com
#19925: Models validator should check if UserModel.REQUIRED_FIELDS is list
-------------------------------------+-------------------------------------
Reporter: RomanAlexander | Owner: nobody

Type: | Status: new
Cleanup/optimization | Version: master
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by streeter):

Crap, sorry, I just realized that there was another pull request by the
reporter as well. And it looks like we solved it just about the same way.
The only differences that I see are that I check that REQUIRED_FIELDS is a
list/tuple before checking that cls.USERNAME is not in the list, which may
be preferable. I also added tests for the change to the same places the
other two AUTH_USER_MODEL validation issues.

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

Django

unread,
Jun 7, 2013, 8:01:59 PM6/7/13
to django-...@googlegroups.com
#19925: Models validator should check if UserModel.REQUIRED_FIELDS is list
-------------------------------------+-------------------------------------
Reporter: RomanAlexander | Owner: nobody
Type: | Status: closed
Cleanup/optimization | Version: master
Component: Database layer | Resolution: fixed

(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"69373f3420d28597332a72269b5fae721cc6ae19"]:
{{{
#!CommitTicketReference repository=""
revision="69373f3420d28597332a72269b5fae721cc6ae19"
Fixed #19925 - Added validation for REQUIRED_FIELDS being a list

Thanks Roman Alexander for the suggestion.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/19925#comment:4>

Django

unread,
Jun 8, 2013, 7:53:56 PM6/8/13
to django-...@googlegroups.com
#19925: Models validator should check if UserModel.REQUIRED_FIELDS is list
--------------------------------+--------------------------------------
Reporter: RomanAlexander | Owner: nobody
Type: Uncategorized | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed
Keywords: 1 | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
--------------------------------+--------------------------------------
Changes (by ogpcludi <sample@…>):

* needs_better_patch: 0 => 1
* component: Database layer (models, ORM) => contrib.admin
* needs_tests: 0 => 1
* keywords: => 1
* needs_docs: 0 => 1
* ui_ux: 0 => 1
* type: Cleanup/optimization => Uncategorized
* stage: Accepted => Unreviewed


Comment:

1

--
Ticket URL: <https://code.djangoproject.com/ticket/19925#comment:5>

Django

unread,
Jun 8, 2013, 7:53:57 PM6/8/13
to django-...@googlegroups.com
#19925: Models validator should check if UserModel.REQUIRED_FIELDS is list
--------------------------------+--------------------------------------
Reporter: RomanAlexander | Owner: nobody

Type: Uncategorized | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed
Keywords: 1 | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
--------------------------------+--------------------------------------
Changes (by ogpcludi <sample@…>):

* needs_better_patch: 0 => 1
* component: Database layer (models, ORM) => contrib.admin
* needs_tests: 0 => 1
* keywords: => 1
* needs_docs: 0 => 1
* ui_ux: 0 => 1
* type: Cleanup/optimization => Uncategorized
* stage: Accepted => Unreviewed


Comment:

1

--
Ticket URL: <https://code.djangoproject.com/ticket/19925#comment:6>

Django

unread,
Jun 8, 2013, 8:07:05 PM6/8/13
to django-...@googlegroups.com
#19925: Models validator should check if UserModel.REQUIRED_FIELDS is list
--------------------------------+--------------------------------------
Reporter: RomanAlexander | Owner: nobody

Type: Uncategorized | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed
Keywords: 1 | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
--------------------------------+--------------------------------------

Comment (by ogpcludi <sample@…>):

1

--
Ticket URL: <https://code.djangoproject.com/ticket/19925#comment:7>

Django

unread,
Jun 8, 2013, 8:07:07 PM6/8/13
to django-...@googlegroups.com
#19925: Models validator should check if UserModel.REQUIRED_FIELDS is list
--------------------------------+--------------------------------------
Reporter: RomanAlexander | Owner: nobody

Type: Uncategorized | Status: closed
Component: contrib.admin | Version: master
Severity: Normal | Resolution: fixed
Keywords: 1 | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 1
--------------------------------+--------------------------------------

Comment (by ogpcludi <sample@…>):

1

--
Ticket URL: <https://code.djangoproject.com/ticket/19925#comment:8>

Reply all
Reply to author
Forward
0 new messages