jcugat / django-custom-user

Custom user model for Django with the same behaviour as the default User class but with email instead of username.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Edit New issue Subclassing AbstractEmailUser does not prompt for superuser on syncdb to blank database

carn1x opened this issue · comments

I am virtually copying EmailUser, but just adding a field:

class CustomUser(AbstractEmailUser):
    """
    Subclass EmailUser to add the last_seen date.
    """
    last_seen = models.DateField(auto_now_add=True)

    class Meta(AbstractEmailUser.Meta):
        swappable = 'AUTH_USER_MODEL'

If I syncdb to a blank DB with AUTH_USER_MODEL = 'custom_user.EmailUser' then I am prompted for superuser no problem. But with my custom model above, no such luck.

I know I can call createsuperuser but I'd like to understand what I'm missing :)

Thanks for any advice :D

I am trying with Django 1.7 and your CustomUser model, and after executing ./manage.py syncdb it asks if I want to create a superuser. Can you give more details?

Closing due to inactivity.