2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Protected settings fix (#5229)

* Hide protected setting in settings view

* Implement custom serializer for setting value

- Return '***' if the setting is protected

* Implement to_internal_value

* Stringify

* Add protected setting to sample plugin

* Unit tests for plugin settings API

* Update unit test
This commit is contained in:
Oliver
2023-07-12 16:29:08 +10:00
committed by GitHub
parent ee274739a6
commit 01f2aa5f74
4 changed files with 103 additions and 11 deletions

View File

@ -22,7 +22,9 @@
{{ setting.description }}
</td>
<td>
{% if setting.is_bool %}
{% if setting.protected %}
<span style='color: red;'>***</span> <span class='fas fa-lock icon-red'></span>
{% elif setting.is_bool %}
{% include "InvenTree/settings/setting_boolean.html" %}
{% else %}
<div id='setting-{{ setting.pk }}'>