Skip to content

Commit

Permalink
Errbit | CodeSystem serializer text field | literal eval try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed May 21, 2024
1 parent fdac087 commit 3f43a33
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/code_systems/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ def to_internal_value(self, data):
return dict(validated_data)

def to_representation(self, instance):
obj = ast.literal_eval(instance)
try:
obj = ast.literal_eval(instance)
except: # pylint: disable=bare-except
obj = instance
return super().to_representation(obj)


Expand Down

0 comments on commit 3f43a33

Please sign in to comment.