mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +00:00 
			
		
		
		
	make sure protected values are never exposed
This commit is contained in:
		| @@ -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): | ||||||
|     """ |     """ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user