Prevent DB changes for read_only tower configurations

This commit is contained in:
Aaron Tan
2017-07-24 12:07:55 -04:00
parent 963ded4594
commit faa244da8c
2 changed files with 8 additions and 3 deletions

View File

@@ -116,6 +116,9 @@ class SettingsRegistry(object):
def is_setting_encrypted(self, setting):
return bool(self._registry.get(setting, {}).get('encrypted', False))
def is_setting_read_only(self, setting):
return bool(self._registry.get(setting, {}).get('read_only', False))
def get_setting_field(self, setting, mixin_class=None, for_user=False, **kwargs):
from rest_framework.fields import empty
field_kwargs = {}