File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -83,29 +83,32 @@ class DjangoEnumPropertiesMeta(ChoicesMeta): # type: ignore
83
83
Needs to be strict subclass of same metaclass as Enum to make it to
84
84
the ImportError.
85
85
"""
86
- def __new__ ( mcs , * args , ** kwargs ): # pylint: disable=W0231
86
+ def __init__ ( self , * args , ** kwargs ): # pylint: disable=W0231
87
87
raise ImportError (
88
- f'{ mcs .__name__ } requires enum-properties to be '
88
+ f'{ self . __class__ .__name__ } requires enum-properties to be '
89
89
f'installed.'
90
90
)
91
91
92
92
class TextChoices ( # type: ignore
93
93
DjangoSymmetricMixin ,
94
94
str ,
95
- Choices
95
+ Choices ,
96
+ metaclass = ChoicesMeta
96
97
):
97
98
"""Raises ImportError on class definition"""
98
99
99
100
class IntegerChoices ( # type: ignore
100
101
DjangoSymmetricMixin ,
101
102
int ,
102
- Choices
103
+ Choices ,
104
+ metaclass = ChoicesMeta
103
105
):
104
106
"""Raises ImportError on class definition"""
105
107
106
108
class FloatChoices ( # type: ignore
107
109
DjangoSymmetricMixin ,
108
110
float ,
109
- Choices
111
+ Choices ,
112
+ metaclass = ChoicesMeta
110
113
):
111
114
"""Raises ImportError on class definition"""
You can’t perform that action at this time.
0 commit comments