Skip to content

Commit

Permalink
Inline comments to clarify how 'allow_csv_value_templates_if_field_em…
Browse files Browse the repository at this point in the history
…pty' works (#856).
  • Loading branch information
mjordan committed Dec 2, 2024
1 parent 5402645 commit 124e83b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion workbench_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10244,7 +10244,7 @@ def get_page_title_from_template(config, parent_title, weight):


def apply_csv_value_templates(config, template_config_setting, row):
"""Applies a simple template to a CSV value. Template variables availalbe are: $csv_value, $file,
"""Applies templates to values in a CSV row. Template variables available are: $csv_value, $file,
$filename_without_extension, $weight, $random_alphanumeric_string, $random_number_string, and
$uuid_string.
"""
Expand Down Expand Up @@ -10318,6 +10318,10 @@ def apply_csv_value_templates(config, template_config_setting, row):
)
outgoing_subvalues.append(subvalue)

# Note: fields that are registered in "csv_value_templates_for_paged_content" should
# also be listed in "allow_csv_value_templates_if_field_empty" since those fields will
# be empty when applied to pages. Fields not listed in "allow_csv_value_templates_if_field_empty"
# will not be applied to pages.
if (
len(row[field]) == 0
and field in config["allow_csv_value_templates_if_field_empty"]
Expand Down

0 comments on commit 124e83b

Please sign in to comment.