#19049: Subclassing AbstractUser doesn't work
-------------------------------+--------------------
     Reporter:  ivan_virabyan  |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  contrib.auth   |    Version:  master
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 According to https://docs.djangoproject.com/en/dev/topics/auth/#extending-
 django-s-default-user I created my own User model


 {{{
 from django.contrib.auth.models import AbstractUser

 class User(AbstractUser):
     avatar = models.ImageField(upload_to='avatars')

 }}}

 but django complains:


 {{{
 CommandError: One or more models did not validate:
 accounts.user: Accessor for m2m field 'groups' clashes with related m2m
 field 'Group.user_set'. Add a related_name argument to the definition for
 'groups'.
 accounts.user: Accessor for m2m field 'user_permissions' clashes with
 related m2m field 'Permission.user_set'. Add a related_name argument to
 the definition for 'user_permissions'.
 auth.user: Accessor for m2m field 'groups' clashes with related m2m field
 'Group.user_set'. Add a related_name argument to the definition for
 'groups'.
 auth.user: Accessor for m2m field 'user_permissions' clashes with related
 m2m field 'Permission.user_set'. Add a related_name argument to the
 definition for 'user_permissions'.
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19049>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to