#32807: JSONField.bound_data raises TypeError when data is None
-----------------------------------------+---------------------------
Reporter: strokirk | Owner: nobody
Type: Uncategorized | Status: new
Component: Forms | Version: 3.2
Severity: Normal | Keywords: JSONField
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-----------------------------------------+---------------------------
Hi,
When a bound form with no value provided for the JSONField is rendered, it
will currently crash.
{{{
class JSONForm(Form):
json_field = JSONField(required=False)
form = JSONForm({})
assert form.as_p()
}}}
raises
{{{
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
}}}
A fix has been created already by @AlexHill here:
https://github.com/django/django/pull/13844
--
Ticket URL: <https://code.djangoproject.com/ticket/32807>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.7ad000dd139902124a6daeffa85c57da%40djangoproject.com.