jmrivas86/django-json-widget

JSONField not set to null after being set to empty

Opened this issue · 0 comments

  • django-json-widget version: master/325ad3027b3915a2d41552c6e113453a9e56dd05 and 0.2.0
  • Django version: 2.2.4
  • Python version: 3.7.2
  • Operating System: Debian Stretch

Description

To reproduce:

  • Enable JSONEditorWidget on a JSONField in admin
  • Set JSONField value in admin to some non-empty json.
  • Save model in admin
  • Set the JSONField to empty by clearing the contents of the widget completely.
  • Save model in admin

What happens: The field does not get changed, it is still set to the original non-empty json and no error is displayed.

What I expected to happen: I expected the field to get set to null/None or I expected to at least get an error that the update to the field failed.