Skip to content

Commit

Permalink
Updated __get_value method to convert enum values to string format
Browse files Browse the repository at this point in the history
  • Loading branch information
gabino committed Dec 23, 2024
1 parent b167c75 commit 9221198
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion agave/lib/mongoengine/enum_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 9221198

Please sign in to comment.