mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
make sure protected values are never exposed
This commit is contained in:
parent
1798214cd2
commit
1a6a26204e
@ -45,6 +45,18 @@ class SettingsSerializer(InvenTreeModelSerializer):
|
||||
|
||||
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):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user