def to_python(self, value):
        if value in self.empty_values:
            return None
        try:
            return json.loads(value)
        except ValueError:
            raise forms.ValidationError(
                self.error_messages['invalid'],
                code='invalid',
                params={'value': value},
            )
dataset/ETHPy150Open django/django/django/contrib/postgres/forms/jsonb.py/JSONField.to_python/original