From 92211980b463818959e785e92b19e6090be5b5a8 Mon Sep 17 00:00:00 2001 From: gabino Date: Mon, 23 Dec 2024 12:41:21 -0600 Subject: [PATCH] Updated __get_value method to convert enum values to string format --- agave/lib/mongoengine/enum_field.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))