#27697: JSONField with blank=True is rendered as non-required field in a 
ModelForm
-------------------------------------+-------------------------------------
     Reporter:  aruseni              |                    Owner:  Andrew
                                     |  Nester
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  1.10
  (models, ORM)                      |
     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 Jacob Walls):

 I suggest marking as a duplicate of #22224. Any proposal to run model-
 validation on not-nullable blankable fields would fix both (but I suggest
 `wontfix`ing #22224 as the status quo represents a supported design
 pattern, will comment there shortly).

 Re: Tim's suggestion:
 > if nothing is submitted, that empty string is transformed into an empty
 dict so it can be saved

 I think this is dangerous because we should preserve the distinction
 between `None` and `{}`, in case the field is nullable. There could be
 code depending on this distinction.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/27697#comment:12>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.a4819c8dc7b8b8d20820ef7aebdf8656%40djangoproject.com.

Reply via email to