do not try to access anon users settings

This commit is contained in:
Matthias 2022-05-17 01:03:04 +02:00
parent 94a19727da
commit 7a2b17e939
No known key found for this signature in database
GPG Key ID: AB6D0E6C4CB65093

View File

@ -329,7 +329,7 @@ def settings_value(key, *args, **kwargs):
"""
if 'user' in kwargs:
if not kwargs['user']:
if not kwargs['user'] or (kwargs['user'] and kwargs['user'].is_authenticated == False):
return InvenTreeUserSetting.get_setting(key)
return InvenTreeUserSetting.get_setting(key, user=kwargs['user'])