daniyalzade / django_reverse_admin

Django Reverse Admin
BSD 3-Clause "New" or "Revised" License
199 stars 54 forks source link

Error when form submit from superuser #287

Open rp-odoodeveloper opened 2 years ago

rp-odoodeveloper commented 2 years ago

Whenever there is a validation error with the reverse_inline formfields it will result in JSONDecodeError: Expecting value: line 1 column 1 (char 0) instead of a proper django ValidationError. In models.py: notes = models.TextField(null=True, blank=True, validators=[custom_validator])

custom_validator contains

try:
    qUserData = json.loads(value)
except json.JSONDecodeError:
    raise ValidationError("Not in JSON Format ")

when login from superuser and try to save data then throw an below error: JSONDecodeError: Expecting value: line 1 column 1 (char 0)