﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35259	forms.JSONField validator doesn't match documentation behavior	Jake Klingensmith	nobody	"If you have a required JSONField on a model and you make a model form, the model form rejects falsey values as empty ([] for sure, possibly others as well). The documentation says that None is the empty value for the forms.JSONField. 

I've seen similar documented issues with regards to the admin panel, not sure if they're running off the same code or not, but it doesn't seem to be resolved in this case.

For example:

{{{
class FooForm(forms.Form)
    bar = forms.JSONField(required=True)

# in shell
f = FooForm(data={""bar"": []})
f.is_valid()  # False
f.errors       # {'bar': ['This field is required.']}
}}}

This contradicts the documentation, as well as the behavior of the JSON model field, so that JSON fields create undesirable behavior in ModelForms.

I'm using Django 3.2, not sure if this behavior is fixed in a later version."	Bug	closed	Forms	5.0	Normal	duplicate	JSONField		Unreviewed	0	0	0	0	0	0
