Fix user check

This commit is contained in:
Matthias 2022-05-06 00:11:26 +02:00
parent 164a8acf33
commit fe4b264ae1
No known key found for this signature in database
GPG Key ID: AB6D0E6C4CB65093
2 changed files with 3 additions and 1 deletions

View File

@ -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):

View File

@ -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)