Skip to content

Commit

Permalink
Catch explicit json decode exception
Browse files Browse the repository at this point in the history
  • Loading branch information
harrywhite4 committed Jun 10, 2020
1 parent cf29429 commit e5f537d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_jsonforms/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def to_python(self, value):
if isinstance(value, str):
try:
return json.loads(value)
except:
except json.JSONDecodeError:
raise ValidationError('Invalid JSON')
return value

Expand Down

0 comments on commit e5f537d

Please sign in to comment.