Explorar el Código

fixed json field save issue #14689

Abhimanyu Saharan hace 2 años
padre
commit
d8fb5a819f
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      netbox/utilities/forms/fields/fields.py

+ 2 - 0
netbox/utilities/forms/fields/fields.py

@@ -93,6 +93,8 @@ class JSONField(_JSONField):
     """
     """
     Custom wrapper around Django's built-in JSONField to avoid presenting "null" as the default text.
     Custom wrapper around Django's built-in JSONField to avoid presenting "null" as the default text.
     """
     """
+    empty_values = [None, '', ()]
+
     def __init__(self, *args, **kwargs):
     def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
         super().__init__(*args, **kwargs)
         if not self.help_text:
         if not self.help_text: