On Fri, Oct 19, 2012 at 3:50 AM, Chris Pagnutti
<chris.pagnu...@gmail.com> wrote:
> Blarghh!  Ok, I'm serious that I spent considerable time Googling, poring
> over the contrib.auth and core files and otherwise staring at my screen to
> try to fix this on my own before posting.  But of course I figure it out two
> minutes after I wasted the time of anyone who actually read this post.
>
> The problem was that I had
> USERNAME_FIELD = 'username'
> REQUIRED_FIELDS = ['username','email','first_name'...]
> in my user class.  Once I removed 'username' from the REQUIRED_FIELDS, it
> worked like a charm.
>
> Lesson learned: Read the docs more carefully
> "REQUIRED_FIELDS must contain all required fields on your User model, but
> should not contain theUSERNAME_FIELD."

Always a good lesson to learn :-)

However, you raise a valid point. This is an error case that we should
be able to validate. It's easy to check "if USERNAME_FIELD in
REQUIRED_FIELDS", and your first experience shouldn't be an obscure
error message about duplicated data. I've raised ticket #19150 to
track this. Thanks for the report!

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to