-
-
Notifications
You must be signed in to change notification settings - Fork 515
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
What's wrong
Since version 5.0.0 (probably since #2000), the following code fails:
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
class Meta(AbstractUser.Meta): # error: Name "AbstractUser.Meta" is not defined
passobviously this example is shortened, but I think you get the Idea. While it is true that a basic Model does not have a Meta-attribute, this is not valid for basically any Subclass for Meta, and using this inheritance is actually the recommended way by django docs:
- https://docs.djangoproject.com/en/dev/topics/db/models/#meta-inheritance
- https://docs.djangoproject.com/en/dev/topics/auth/customizing/#using-a-custom-user-model-when-starting-a-project
How is that should be
AbstractUser.Meta should exist for inheritance.
System information
- OS: Linux (Alpine and Arch tested, but the problem should be valid regardless)
pythonversion: 3.12djangoversion: 5.0.4mypyversion: 1.10.0django-stubsversion: 5.0.0django-stubs-extversion: none
9128305, basicdays, brianhelba and tylerlaprade
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working