hide survey passwords in saved launch configs

This commit is contained in:
AlanCoding
2017-12-11 16:07:13 -05:00
parent 1bc2d83403
commit 659d31324d
8 changed files with 142 additions and 47 deletions

View File

@@ -233,7 +233,7 @@ class SurveyJobTemplateMixin(models.Model):
choice_list))
return errors
def _accept_or_ignore_variables(self, data, errors=None):
def _accept_or_ignore_variables(self, data, errors=None, _exclude_errors=()):
survey_is_enabled = (self.survey_enabled and self.survey_spec)
extra_vars = data.copy()
if errors is None:
@@ -266,7 +266,7 @@ class SurveyJobTemplateMixin(models.Model):
# Leftover extra_vars, keys provided that are not allowed
rejected.update(extra_vars)
# ignored variables does not block manual launch
if not getattr(self, '_is_manual_launch', False):
if 'prompts' not in _exclude_errors:
errors['extra_vars'] = [_('Variables {list_of_keys} are not allowed on launch.').format(
list_of_keys=', '.join(extra_vars.keys()))]