django-stubs: error: Definition of "_meta" in base class "PermissionsMixin" is incompatible with definition in base class "AbstractBaseUser"
Bug report
What’s wrong
We have defined a custom AuthUser model in our project like:
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
class AuthUser(PermissionsMixin, AbstractBaseUser):
class Meta:
verbose_name = _('Auth User')
abstract = False
db_table = 'auth_user'
mypy gives an error:
myproject/models/auth.py:3: error: Definition of "_meta" in base class "PermissionsMixin" is incompatible with definition in base class "AbstractBaseUser"
(from the class AuthUser(PermissionsMixin, AbstractBaseUser): line)
The slightly weird part is Django’s PermissionMixin and AbstractBaseUser both have an identical Meta:
class Meta:
abstract = True
How is that should be
No error
System information
- OS:
pythonversion: 3.8.3djangoversion: 2.2.12mypyversion: 0.782django-stubsversion: 1.5.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 20 (9 by maintainers)
Hey all, is there any update for this issue? I’m having the same problem.
I’m still having this issue too. How can we fix it? Or at least set it to ignore if you aren’t going to.
mypy
0.950django-stubs1.11.0Still having this issue