mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-25 09:21:48 -05:00
Add support for encrypting settings that are passwords.
This commit is contained in:
@@ -45,6 +45,8 @@ class SettingFieldMixin(object):
|
||||
"""Mixin to use a registered setting field class for API display/validation."""
|
||||
|
||||
def to_representation(self, obj):
|
||||
if getattr(self, 'encrypted', False) and isinstance(obj, basestring) and obj:
|
||||
return '$encrypted$'
|
||||
return obj
|
||||
|
||||
def to_internal_value(self, value):
|
||||
|
||||
Reference in New Issue
Block a user