1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #3501: Fix rendering of checkboxes on custom script forms

This commit is contained in:
Jeremy Stretch
2019-09-13 11:45:35 -04:00
parent 57d35181f0
commit 5962e7c942
2 changed files with 3 additions and 1 deletions

View File

@@ -61,7 +61,8 @@ class ScriptVariable:
Render the variable as a Django form field.
"""
form_field = self.form_field(**self.field_attrs)
form_field.widget.attrs['class'] = 'form-control'
if not isinstance(form_field.widget, forms.CheckboxInput):
form_field.widget.attrs['class'] = 'form-control'
return form_field