diff --git a/django/db/models/enums.py b/django/db/models/enums.py index 51821a2b458..f04698b9f6b 100644 --- a/django/db/models/enums.py +++ b/django/db/models/enums.py @@ -8,7 +8,7 @@ __all__ = ['Choices', 'IntegerChoices', 'TextChoices'] class ChoicesMeta(enum.EnumMeta): """A metaclass for creating a enum choices.""" - def __new__(metacls, classname, bases, classdict): + def __new__(metacls, classname, bases, classdict, **kwds): labels = [] for key in classdict._member_names: value = classdict[key] @@ -25,7 +25,7 @@ class ChoicesMeta(enum.EnumMeta): # Use dict.__setitem__() to suppress defenses against double # assignment in enum's classdict. dict.__setitem__(classdict, key, value) - cls = super().__new__(metacls, classname, bases, classdict) + cls = super().__new__(metacls, classname, bases, classdict, **kwds) cls._value2label_map_ = dict(zip(cls._value2member_map_, labels)) # Add a label property to instances of enum which uses the enum member # that is passed in as "self" as the value to use when looking up the