make sure protected values are never exposed

This commit is contained in:
Matthias 2021-11-20 00:24:17 +01:00
parent 1798214cd2
commit 1a6a26204e
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -45,6 +45,18 @@ class SettingsSerializer(InvenTreeModelSerializer):
return results return results
def get_value(self, obj):
"""
Make sure protected values are not returned
"""
result = obj.value
# never return protected values
if obj.is_protected:
result = '***'
return result
class GlobalSettingsSerializer(SettingsSerializer): class GlobalSettingsSerializer(SettingsSerializer):
""" """