exclude password fields from skipping if not defined

This commit is contained in:
Peter Braun
2026-02-17 12:19:43 +01:00
parent d2e51c4124
commit ed1b5c5519

View File

@@ -188,8 +188,14 @@ class SurveyJobTemplateMixin(models.Model):
runtime_extra_vars.pop(variable_key)
if default is not None:
# do not add variables that contain an empty string, are not required and are nor present in extra_vars
if default == '' and not survey_element.get('required') and variable_key not in runtime_extra_vars:
# do not add variables that contain an empty string, are not required and are not present in extra_vars
# password fields must be skipped, because default values have special behaviour
if (
default == ''
and not survey_element.get('required')
and survey_element.get('type') != 'password'
and variable_key not in runtime_extra_vars
):
continue
decrypted_default = default