title: Can't log in after updating User model details in Django
body: <p>I have a user model that extended from AbstractBaseUser I've shown that below</p>
  <pre><code>class User(AbstractBaseUser,PermissionsMixin):
      email = models.EmailField(verbose_name='email', max_length=80, unique=True)
      username = models.CharField(max_length=30, unique=True)
      first_name = models.CharField(max_length=100,null=True)
      last_name = models.CharField(max_length=100,null=True)
      phone_no = models.CharField(max_length=12, null=True)
      date_joined = models.DateField(
          verbose_name='date joined', auto_now_add=True)
      last_login = models.DateField(verbose_name='last login', auto_now=True)
      is_admin = models.BooleanField(default=False)
      is_active = models.BooleanField(default=True)
      is_staff = models.BooleanField(default=False)
      is_superuser = models.BooleanField(default=False)
      is_teacher = models.BooleanField(default=False)
      address = models.CharField(max_length=500, null=True, blank=True)
  
      USERNAME_FIELD = 'email'
      REQUIRED_FIELDS = ['username']
  
      objects = MyAccountManager()
  
      def __str__(self):
          return self.email
  
      # def has_perm(self, perm, obj=None):
      #     return self.is_admin
  
      def has_module_perms(self, app_label):
          return True
  
  </code></pre>
  <p>Also, I need to update the User's details by using the view mentioned below</p>
  <pre><code>class UpdateUser(RetrieveUpdateAPIView):
      permission_classes = (IsAuthenticated,)
      serializer_class = UserSerializerAPI
      queryset = User.objects.all()
  </code></pre>
  <p>After Changing user model details I can not log in. I'm using rest-auth login URL to log user in. When I try to log in it gives me an error saying</p>
  <p>{
  &quot;non_field_errors&quot;: [
  &quot;Unable to log in with provided credentials.&quot;
  ]
  }</p>
  <p>What is the reason for that</p>