Skip to content

Commit

Permalink
Sanitize Enums
Browse files Browse the repository at this point in the history
  • Loading branch information
utf committed Oct 31, 2020
1 parent 27a51a7 commit 9e0a47f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions emmet-core/emmet/core/utils.py
Expand Up @@ -94,6 +94,8 @@ def jsanitize(obj, strict=False, allow_bson=False):
return [
jsanitize(i, strict=strict, allow_bson=allow_bson) for i in obj.tolist()
]
if isinstance(obj, Enum):
return obj.value
if isinstance(obj, dict):
return {
k.__str__(): jsanitize(v, strict=strict, allow_bson=allow_bson)
Expand Down

0 comments on commit 9e0a47f

Please sign in to comment.