diff --git a/InvenTree/part/templatetags/inventree_extras.py b/InvenTree/part/templatetags/inventree_extras.py index 38689df26b..8c28d997f6 100644 --- a/InvenTree/part/templatetags/inventree_extras.py +++ b/InvenTree/part/templatetags/inventree_extras.py @@ -18,7 +18,7 @@ from InvenTree import version, settings import InvenTree.helpers -from common.models import InvenTreeSetting, ColorTheme +from common.models import InvenTreeSetting, ColorTheme, InvenTreeUserSetting from common.settings import currency_code_default register = template.Library() @@ -182,11 +182,12 @@ def setting_object(key, *args, **kwargs): """ Return a setting object speciifed by the given key (Or return None if the setting does not exist) + if a user-setting was requested return that """ - setting = InvenTreeSetting.get_setting_object(key) - - return setting + if 'user' in kwargs: + return InvenTreeUserSetting.get_setting_object(key, user=kwargs['user']) + return InvenTreeSetting.get_setting_object(key) @register.simple_tag() diff --git a/InvenTree/templates/InvenTree/settings/setting.html b/InvenTree/templates/InvenTree/settings/setting.html index 7376adf8d9..66f3f9f3b0 100644 --- a/InvenTree/templates/InvenTree/settings/setting.html +++ b/InvenTree/templates/InvenTree/settings/setting.html @@ -1,7 +1,12 @@ {% load inventree_extras %} {% load i18n %} -{% setting_object key as setting %} +{% if user_setting %} + {% setting_object key user=request.user as setting %} +{% else %} + {% setting_object key as setting %} +{% endif %} +