Skip to content

Fix type hint on model in BaseModelAdminMixin.__init__ #1499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AppSynergy
Copy link

See #1483.

The model arg is the class, not an instance of it.

Example

I can see this removes the type checking error from the user_model_admin fixture.

where e.g. with pyright I was previously seeing:

Argument of type "type[AbstractUser]" cannot be assigned to parameter "model" of type "Model" in function "__init__"
Type "type[AbstractUser]" is not assignable to type 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant