Closed adambirds closed 3 months ago
Have alost tested with mypy 0.991 and django-stubs 1.14.0 too and still an issue.
I'm using a similar pattern and haven't bumped into this problem -- one difference is that my User
is a subclass of AbstractUser
rather than AbstractBaseUser
, does changing that mitigate the issue?
Unfortunately its impossible for me to change now and there were several reasons originally why I had to use the AbstractBaseUser instead but I can't remember why now.
Bug report
What's wrong
Getting the below error in my views:
"AbstractBaseUser" has no attribute "is_staff"
I use a custom user model, see below:
models.py
:views.py
:settings.py
:How is that should be
There shouldn't be this error.
System information
python
version: 3.10.6django
version: 4.1.5mypy
version: 0.931django-stubs
version: 1.12.0django-stubs-ext
version: 0.7.0