Skip to content

Error when form submit from superuser #287

@rp-odoodeveloper

Description

@rp-odoodeveloper

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions