#27697: JSONField with blank=True is rendered as non-required field in a
ModelForm
-------------------------------------+-------------------------------------
Reporter: aruseni | Owner: Andrew
| Nester
Type: Bug | Status: assigned
Component: contrib.postgres | Version: 1.10
Severity: Normal | Resolution:
Keywords: postgres | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Andrew Nester):
Thanks Tim!
I've just updated my PR to make it work more clear.
Now it's working like this.
If we have {{{blank=True}}} set , form field will be render as NOT
required and valid empty JSON string such as {}, [] will be successfully
validated and saved.
But if you try to submit just empty form field, you will get form
validation error with message {{{ 'None' value must be valid JSON.}}}
[[Image(https://code.djangoproject.com/attachment/ticket/27697/Screen%20Shot%202017-02-10%20at%202.19.21%20PM.png)]]
--
Ticket URL: <https://code.djangoproject.com/ticket/27697#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.8b46eff9eae8ebb20a6b5cf51bf6d2cb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.