-
-
Notifications
You must be signed in to change notification settings - Fork 521
Open
Labels
3rd partyPresence of a third party dependency has been mentionedPresence of a third party dependency has been mentionedbugSomething isn't workingSomething isn't workingmypy-pluginIssues specific to mypy_django_pluginIssues specific to mypy_django_plugin
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
pythonversion: 3.10.4djangoversion: 4.0.6mypyversion: 0.971django-stubsversion: 1.12.0django-stubs-extversion: 0.5.0
Metadata
Metadata
Assignees
Labels
3rd partyPresence of a third party dependency has been mentionedPresence of a third party dependency has been mentionedbugSomething isn't workingSomething isn't workingmypy-pluginIssues specific to mypy_django_pluginIssues specific to mypy_django_plugin