From 3cd746466e70c0a793682923b2a566507766f325 Mon Sep 17 00:00:00 2001 From: Torsten Engelbrecht Date: Wed, 13 Jul 2011 10:43:34 +0800 Subject: [PATCH] fix some bugs when trying to change values and displaying help messages --- dynamicsettings/__init__.py | 2 +- dynamicsettings/templates/dynamicsettings/settings.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dynamicsettings/__init__.py b/dynamicsettings/__init__.py index 9dce5cf..0f8547e 100644 --- a/dynamicsettings/__init__.py +++ b/dynamicsettings/__init__.py @@ -85,7 +85,7 @@ def set(self, key, value, value_type=None): dynamic_setting.save() #refresh the cache self._get_settings() - return dynamic_setting.value + return True raise KeyError('Setting "%s" can not be set in the database. If you want to change the setting add it to DYNAMICSETTINGS_INCLUDE_SETTINGS.' % key) def reset(self, key): diff --git a/dynamicsettings/templates/dynamicsettings/settings.html b/dynamicsettings/templates/dynamicsettings/settings.html index cab6db1..e1e0c6c 100644 --- a/dynamicsettings/templates/dynamicsettings/settings.html +++ b/dynamicsettings/templates/dynamicsettings/settings.html @@ -32,8 +32,8 @@

Dynamic settings:

{% for setting in dynamic_settings %} - {{setting.key}} - {% if setting.type == "tuple" or settings.type == "list" or setting.type == "dict" %} + {{setting.key}} + {% if setting.type == "list" or setting.type == "dict" or setting.type == "tuple"%} ? {% endif %}