Merge pull request #3974 from AlanCoding/notification_test

Avoid using serialized notification configuraiton
This commit is contained in:
Alan Rominger 2016-11-11 15:32:15 -05:00 committed by GitHub
commit 1885ca0adc

View File

@ -2680,9 +2680,10 @@ class NotificationTemplateSerializer(BaseSerializer):
def to_representation(self, obj):
ret = super(NotificationTemplateSerializer, self).to_representation(obj)
for field in obj.notification_class.init_parameters:
if field in ret['notification_configuration'] and \
force_text(ret['notification_configuration'][field]).startswith('$encrypted$'):
ret['notification_configuration'][field] = '$encrypted$'
config = obj.notification_configuration
if field in config and force_text(config[field]).startswith('$encrypted$'):
config[field] = '$encrypted$'
ret['notification_configuration'] = config
return ret
def get_related(self, obj):