Hi,

I extend the django user model as described in the dev doc. I wan't to keep 
most of the original User model features so I extend the AbstractUser 
class. I've defined in settings.py:

    AUTH_USER_MODEL = 'myapp.CustomUser'

My user class: 

    class CustomUser(AbstractUser):
      custom_field = models.ForeignKey('OtherModel')
      objects = UserManager()

Everything seems to work fine but when I try to make it managed by the 
admin site:

    admin.site.register(CustomUser, UserAdmin)

I get this error on the admin CustomUser creation page (after validation of 
the password confirmation form): 
    
    AttributeError: Manager isn't available; User has been swapped for 
'myapp.CustomUser'

The point is that I need this model managed by the admin site in order to 
have the same creation process as with the original User model (two step 
process with password validation).

Thanks for any reply

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/8VtQghtcMFgJ.
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