def clean(self, value, *args, **kwargs):
        if value:
            try:
                # Run the value through JSON so we can normalize formatting
                # and at least learn about malformed data:
                value = json.dumps(
                    json.loads(
                        value,
                        use_decimal=True,
                        object_hook=json_decode_hook,
                    ),
                    use_decimal=True,
                    default=json_encode_default,
                )
            except __HOLE__:
                raise forms.ValidationError("Invalid JSON data!")

        return super(JSONFormField, self).clean(value, *args, **kwargs)
dataset/ETHPy150Open matthiask/plata/plata/fields.py/JSONFormField.clean