Skip to content

Commit

Permalink
fix export issue with empty surveys (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivarmu authored Jan 22, 2025
1 parent 53ceb44 commit be5b214
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelogs/fragments/filetree_create_survey_issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
bugfixes:
- filetree_create job_template and workflow_job_template survey was failing when it was empty
...
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ controller_templates:
-%}
{% if template_overrides_resources.job_template[current_job_templates_asset_value.name].survey_spec is defined
or template_overrides_global.job_template.survey_spec is defined
or (current_job_templates_asset_value.related.survey_spec is defined and survey_spec_contents | length > 0) %}
or (current_job_templates_asset_value.related.survey_spec is defined and survey_spec_contents | length > 0 and survey_spec_contents | first | length > 0) %}
survey_spec:
{% for spec_item in survey_spec_contents %}
name: "{{ spec_item.name }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ controller_workflows:
-%}
{% if template_overrides_resources.workflow_job_template[current_workflow_job_templates_asset_value.name].survey_spec is defined
or template_overrides_global.workflow_job_template.survey_spec is defined
or (current_workflow_job_templates_asset_value.related.survey_spec is defined and survey_spec_contents | length > 0) %}
or (current_workflow_job_templates_asset_value.related.survey_spec is defined and survey_spec_contents | length > 0 and survey_spec_contents | first | length > 0) %}
survey_spec:
{% for spec_item in survey_spec_contents %}
name: "{{ spec_item.name }}"
Expand Down

0 comments on commit be5b214

Please sign in to comment.