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 cd380da63d)
This commit is contained in:
Kirill Zaitsev 2015-05-27 00:38:26 +03:00 committed by Stan Lagun
parent 2584860211
commit c734507e68
1 changed files with 1 additions and 0 deletions

View File

@ -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)