We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0227e0d commit 9e84547Copy full SHA for 9e84547
django_enum/fields.py
@@ -91,7 +91,7 @@ def _coerce_to_value_type(self, value: Any) -> Enum:
91
"""Coerce the value to the enumerations value type"""
92
# note if enum type is int and a floating point is passed we could get
93
# situations like X.xxx == X - this is acceptable
94
- if self.enum:
+ if self.enum and self.primitive:
95
return self.primitive(value)
96
# can't ever reach this - just here to make type checker happy
97
return value # pragma: no cover
0 commit comments