Skip to content

Commit

Permalink
update headline mapping assignment article [SDESK-7061] (#1874)
Browse files Browse the repository at this point in the history
* update headline mapping assignment article [SDESK-7061]

* update logic for mapping headline
  • Loading branch information
devketanpro authored Nov 8, 2023
1 parent 1efa363 commit 003c1c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/planning/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def create_item_from_template(doc, extra_fields_to_override=None, translations=N
translated_value = {
entry["field"]: entry["value"] for entry in translations or [] if entry["language"] == doc.get("language")
}

if not translated_value.get("headline") and translated_value.get("name") and "headline" in fields_to_override:
updates["headline"] = translated_value["name"]

updates.update({key: val for key, val in translated_value.items() if key in fields_to_override})

if len(updates):
Expand Down

0 comments on commit 003c1c5

Please sign in to comment.