Add alert when settings are changed

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-07-05 00:58:50 -04:00
parent 3ce08cc9c0
commit 7902074390
3 changed files with 9 additions and 3 deletions

View File

@@ -34,6 +34,14 @@
{% endif %}
{% block messages %}
{% endblock %}
{% smart_settings_check_changed as settings_changed %}
{% if settings_changed %}
<div class="alert alert-dismissible alert-warning">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<p><strong>{% trans 'Warning' %}</strong> {% trans 'Settings updated, restart your installation for changes to take proper effect.' %}</p>
</div>
{% endif %}
</div>
</div>

View File

@@ -115,8 +115,6 @@ class Setting(object):
if not cls._cache_hash:
cls._cache_hash = cls.get_hash()
print("!!!@@", cls._cache_hash, cls.get_hash())
return cls._cache_hash != cls.get_hash()
@classmethod

View File

@@ -13,6 +13,6 @@ def smart_setting(global_name):
@register.simple_tag
def smart_settings_check_changes():
def smart_settings_check_changed():
return Setting.check_changed()