From c734507e687a788deba811399f756a3c488ea3cc Mon Sep 17 00:00:00 2001 From: Kirill Zaitsev Date: Wed, 27 May 2015 00:38:26 +0300 Subject: [PATCH] Mark BooleanFields as non-required in dynamic_ui Due to the way django validates fields having a required=True fieild almoust never makes sense. This would mean that user would not be able to choose false for the boolean value, that the Field represents, because django would raise an error, stating, that the field is required. This is especially true for fields, generated for HOT template-packages. This patch sets required to False for dynamic_ui. Change-Id: Ibc36017e37bb7df9f7bde2c53265237b21276fd6 Related-Bug: #1450536 (cherry picked from commit cd380da63d95c8a546792c5de25cdc19a4070466) --- muranodashboard/dynamic_ui/fields.py | 1 + 1 file changed, 1 insertion(+) diff --git a/muranodashboard/dynamic_ui/fields.py b/muranodashboard/dynamic_ui/fields.py index a70c2156c..25e0bb4d2 100644 --- a/muranodashboard/dynamic_ui/fields.py +++ b/muranodashboard/dynamic_ui/fields.py @@ -562,6 +562,7 @@ class BooleanField(forms.BooleanField, CustomPropertiesField): else: widget = forms.CheckboxInput(attrs={'class': 'checkbox'}) kwargs['widget'] = widget + kwargs['required'] = False super(BooleanField, self).__init__(*args, **kwargs)