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

Conversation

AppSynergy
Copy link
Contributor

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 

@lukasvinclav lukasvinclav changed the title Fix type hint on model in BaseModelAdminMixin.__init__ fix: type hint on model in BaseModelAdminMixin.__init__ Aug 13, 2025
@lukasvinclav lukasvinclav merged commit b1da84f into unfoldadmin:main Aug 13, 2025
7 checks passed
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.

2 participants