title: Attribute error: 'User' object has no attribute 'is_admin'
body: <p>I have customized user model by extending AbstractBaseUser, the user name only accepted as email id. Here is the model:</p>
  
  <pre><code>class User(AbstractBaseUser, PermissionsMixin):
      email = models.EmailField('email address', unique=True)
      first_name = models.CharField('first name', max_length=30, blank=True)
      last_name = models.CharField('last name', max_length=30, blank=True)
      date_joined = models.DateTimeField('date joined', auto_now_add=True)
      is_active = models.BooleanField('active', default=True)
      is_staff = models.BooleanField(default=False)
  
      objects = UserManager()
  
      USERNAME_FIELD = 'email'
      REQUIRED_FIELDS = []
  
  class Meta:
      verbose_name = 'user'
      verbose_name_plural = 'users'
  
  def get_full_name(self):
      full_name = '%s %s' % (self.first_name, self.last_name)
      return full_name.strip()
  
  def get_short_name(self):
      return self.first_name
  
  def email_user(self, subject, message, from_email=None, **kwargs):
      send_mail(subject, message, from_email, [self.email], **kwargs)
  </code></pre>
  
  <p>The model manager for the above model is:</p>
  
  <pre><code>class UserManager(BaseUserManager):
  use_in_migrations = True
  
  def _create_user(self, email, password, **extra_fields):
      """
      Creates and saves a User with the given email and password.
      """
      if not email:
          raise ValueError('The given email must be set')
      email = self.normalize_email(email)
      user = self.model(email=email, **extra_fields)
      user.set_password(password)
      user.save(using=self._db)
      return user
  
  def create_user(self, email, password=None, **extra_fields):
      extra_fields.setdefault('is_superuser', False)
      return self._create_user(email, password, **extra_fields)
  
  def create_superuser(self, email, password, **extra_fields):
      extra_fields.setdefault('is_superuser', True)
  
      if extra_fields.get('is_superuser') is not True:
          raise ValueError('Superuser must have is_superuser=True.')
  
      return self._create_user(email, password, **extra_fields)
  </code></pre>
  
  <p>I am able to create the custom user but when I am trying to log in I got the attribute error:</p>
  
  <pre><code>Attribute error: 'User' object has no attribute 'is_admin'
  </code></pre>
  
  <p>Below is the admin.py file</p>
  
  <pre><code>class ProfileInline(admin.StackedInline):
  model = Course
  can_delete = False
  verbose_name_plural = 'Course'
  fk_name = 'user'
  
  class CustomUserAdmin(UserAdmin):
      inlines = (ProfileInline, )
  
      def get_inline_instances(self, request, obj=None):
          if not obj:
              return list()
      return super(CustomUserAdmin, self).get_inline_instances(request, obj)
  
  
  admin.site.register(User, CustomUserAdmin)
  </code></pre>