diff --git a/agave/lib/mongoengine/enum_field.py b/agave/lib/mongoengine/enum_field.py index 84374f29..6294728b 100644 --- a/agave/lib/mongoengine/enum_field.py +++ b/agave/lib/mongoengine/enum_field.py @@ -19,7 +19,7 @@ def __init__(self, enum: Type[Enum], *args, **kwargs): super(EnumField, self).__init__(*args, **kwargs) def __get_value(self, enum: Enum) -> str: - return enum.value if hasattr(enum, 'value') else enum + return str(enum.value if hasattr(enum, 'value') else enum) def to_python(self, value: Enum) -> Enum: # pragma: no cover return self.enum(super(EnumField, self).to_python(value))