From 9d7b82085e380865fc035b6f894c1788a0d18c93 Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 19 Nov 2018 12:27:29 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9common=20settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/forms.py | 12 ++++++------ apps/common/templates/common/terminal_setting.html | 4 ++-- apps/jumpserver/settings.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) 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' %}

{% trans "Replay storage" %}

@@ -114,7 +114,7 @@ {% endfor %} - {% trans 'Add' %} + {% trans 'Add' %}
diff --git a/apps/jumpserver/settings.py b/apps/jumpserver/settings.py index 4f469eed3..19419b769 100644 --- a/apps/jumpserver/settings.py +++ b/apps/jumpserver/settings.py @@ -323,7 +323,7 @@ EMAIL_HOST_USER = CONFIG.EMAIL_HOST_USER EMAIL_HOST_PASSWORD = CONFIG.EMAIL_HOST_PASSWORD EMAIL_USE_SSL = CONFIG.EMAIL_USE_SSL EMAIL_USE_TLS = CONFIG.EMAIL_USE_TLS -EMAIL_SUBJECT_PREFIX = CONFIG.EMAIL_SUBJECT_PREFIX or '' +EMAIL_SUBJECT_PREFIX = CONFIG.EMAIL_SUBJECT_PREFIX REST_FRAMEWORK = { # Use Django's standard `django.contrib.auth` permissions,