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.
* 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>
* 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>
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>
* 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>
* 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>
* 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>
Comment (by ogpcludi <sample@…>):
1
--
Ticket URL: <https://code.djangoproject.com/ticket/19925#comment:7>
Comment (by ogpcludi <sample@…>):
1
--
Ticket URL: <https://code.djangoproject.com/ticket/19925#comment:8>