Add a new column to settings showing if they are overrided via environment variable.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-08-26 05:08:27 -04:00
parent 9adf48821d
commit 040c99d809
2 changed files with 11 additions and 0 deletions

View File

@@ -112,6 +112,9 @@
- Add support for extended templates when there are no results.
- Add help messages and useful links to several apps when there
are no results available.
- Add a new column to settings showing if they are overrided
via environment variable.
3.0.3 (2018-08-17)
==================

View File

@@ -3,6 +3,7 @@ from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from common import MayanAppConfig, menu_sidebar, menu_setup, menu_object
from common.widgets import TwoStateWidget
from navigation import SourceColumn
from .classes import Namespace, Setting
@@ -36,6 +37,13 @@ class SmartSettingsApp(MayanAppConfig):
SourceColumn(
source=Setting, label=_('Value'), attribute='serialized_value'
)
SourceColumn(
source=Setting, label=_('Environment variable'),
func=lambda context: TwoStateWidget(
center=True,
state=context['object'].environment_variable
).render()
)
menu_object.bind_links(
links=(link_namespace_detail,), sources=(Namespace,)