mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix user check
This commit is contained in:
parent
164a8acf33
commit
fe4b264ae1
@ -1537,7 +1537,7 @@ class InvenTreeUserSetting(BaseInvenTreeSetting):
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def get_setting_object(cls, key, user):
|
||||
def get_setting_object(cls, key, user=None):
|
||||
return super().get_setting_object(key, user=user)
|
||||
|
||||
def validate_unique(self, exclude=None, **kwargs):
|
||||
|
@ -329,6 +329,8 @@ def settings_value(key, *args, **kwargs):
|
||||
"""
|
||||
|
||||
if 'user' in kwargs:
|
||||
if not kwargs['user']:
|
||||
return InvenTreeUserSetting.get_setting(key)
|
||||
return InvenTreeUserSetting.get_setting(key, user=kwargs['user'])
|
||||
|
||||
return InvenTreeSetting.get_setting(key)
|
||||
|
Loading…
Reference in New Issue
Block a user