diff --git a/apps/common/forms.py b/apps/common/forms.py index 4fb6de03f..d164699fe 100644 --- a/apps/common/forms.py +++ b/apps/common/forms.py @@ -14,16 +14,16 @@ class BaseForm(forms.Form): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) for name, field in self.fields.items(): - db_value = getattr(common_settings, name) + value = getattr(common_settings, name) # django_value = getattr(settings, name) if hasattr(settings, name) else None - if db_value is None: # and django_value is None: + if value is None: # and django_value is None: continue - if db_value is not None: - if isinstance(db_value, dict): - db_value = json.dumps(db_value) - initial_value = db_value + if value is not None: + if isinstance(value, dict): + value = json.dumps(value) + initial_value = value # elif django_value is False or django_value: # initial_value = django_value else: diff --git a/apps/common/templates/common/terminal_setting.html b/apps/common/templates/common/terminal_setting.html index 0435e48e9..d29de997f 100644 --- a/apps/common/templates/common/terminal_setting.html +++ b/apps/common/templates/common/terminal_setting.html @@ -92,7 +92,7 @@ {% endfor %} - {% trans 'Add' %} + {% trans 'Add' %}