Open
Description
I have custom user model that inherits from UserProfile from django-tenant-users package. UserProfile has custom model manager. In my model I see an error from mypy:
Mypy: Could not resolve manager type for "Flow_BE.applications.users.models.User.objects"
and when i try to use this manager I receive error:
Mypy: "Manager[User]" has no attribute "create_user"
This is how models specified:
class User(UserProfile):
"""This User model replaces default user model."""
# from django-tenant-users
class UserProfile(AbstractBaseUser, PermissionsMixinFacade):
objects = UserProfileManager()
class UserProfileManager(BaseUserManager):
def create_user(
self,
email=None,
password=None,
is_staff=False,
**extra_fields,
):...
For User.objects.create_user(...) mypy generates errors. Code works.
System information
- OS: MacOs 12.3.1
python
version: 3.10.4django
version: 4.0.6mypy
version: 0.971django-stubs
version: 1.12.0django-stubs-ext
version: 0.5.0