ensure proper data type for comparison
All checks were successful
Tests / test (push) Successful in 28s
All checks were successful
Tests / test (push) Successful in 28s
This commit is contained in:
parent
903987796f
commit
e1aa9015f2
1 changed files with 10 additions and 0 deletions
|
|
@ -357,6 +357,16 @@ class CustomFormMixin(FormGeneratorMixin):
|
||||||
max_val = field_config.get("max_value")
|
max_val = field_config.get("max_value")
|
||||||
unit = field_config.get("addon_text")
|
unit = field_config.get("addon_text")
|
||||||
|
|
||||||
|
if not isinstance(field, forms.IntegerField):
|
||||||
|
widget = field.widget
|
||||||
|
self.fields[field_name] = forms.IntegerField(
|
||||||
|
label=field.label,
|
||||||
|
help_text=field.help_text,
|
||||||
|
required=field.required,
|
||||||
|
widget=widget,
|
||||||
|
)
|
||||||
|
field = self.fields[field_name]
|
||||||
|
|
||||||
if unit:
|
if unit:
|
||||||
field.widget = NumberInputWithAddon(addon_text=unit)
|
field.widget = NumberInputWithAddon(addon_text=unit)
|
||||||
field.addon_text = unit
|
field.addon_text = unit
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue