mirror of
https://github.com/ansible/awx.git
synced 2026-02-27 07:56:06 -03:30
Skip settings field validation for encrypted fields if submitted value is the $encrypted$ placeholder.
This commit is contained in:
@@ -50,6 +50,8 @@ class SettingFieldMixin(object):
|
||||
return obj
|
||||
|
||||
def to_internal_value(self, value):
|
||||
if getattr(self, 'encrypted', False) and isinstance(value, basestring) and value.startswith('$encrypted$'):
|
||||
raise serializers.SkipField()
|
||||
obj = super(SettingFieldMixin, self).to_internal_value(value)
|
||||
return super(SettingFieldMixin, self).to_representation(obj)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user