Merge pull request #577 from ryanpetrello/release_3.2.2

render survey_spec for display purposes in a safe manner
This commit is contained in:
Ryan Petrello 2017-11-13 15:18:09 -05:00 committed by GitHub
commit 44a2d7a346
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
# Python
import json
from copy import copy
from copy import copy, deepcopy
# Django
from django.db import models
@ -257,7 +257,7 @@ class SurveyJobTemplateMixin(models.Model):
'''
Hide encrypted default passwords in survey specs
'''
survey_spec = self.survey_spec.copy() if self.survey_spec else {}
survey_spec = deepcopy(self.survey_spec) if self.survey_spec else {}
for field in survey_spec.get('spec', []):
if field.get('type') == 'password':
if 'default' in field and field['default']: