diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index eebb566a68..48c99cbbb5 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -194,7 +194,7 @@ class BaseInvenTreeSetting(models.Model): return None @classmethod - def get_setting(cls, key, backup_value=None): + def get_setting(cls, key, backup_value=None, **kwargs): """ Get the value of a particular setting. If it does not exist, return the backup value (default = None) @@ -204,7 +204,7 @@ class BaseInvenTreeSetting(models.Model): if backup_value is None: backup_value = cls.get_setting_default(key) - setting = cls.get_setting_object(key) + setting = cls.get_setting_object(key, **kwargs) if setting: value = setting.value diff --git a/InvenTree/part/templatetags/inventree_extras.py b/InvenTree/part/templatetags/inventree_extras.py index 8c28d997f6..e867441b42 100644 --- a/InvenTree/part/templatetags/inventree_extras.py +++ b/InvenTree/part/templatetags/inventree_extras.py @@ -196,6 +196,8 @@ def settings_value(key, *args, **kwargs): Return a settings value specified by the given key """ + if 'user' in kwargs: + return InvenTreeUserSetting.get_setting(key, user=kwargs['user']) return InvenTreeSetting.get_setting(key)