Skip to content

Commit

Permalink
fix black
Browse files Browse the repository at this point in the history
  • Loading branch information
devketanpro committed Oct 9, 2023
1 parent 154c054 commit 1e44547
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/planning/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
]


def create_item_from_template(doc, extra_fields_to_override=None, translations = None):
def create_item_from_template(doc, extra_fields_to_override=None, translations=None):
fields_to_override = deepcopy(TEMPLATE_FIELDS_TO_OVERRIDE)
if extra_fields_to_override is not None:
fields_to_override.extend(extra_fields_to_override)
Expand All @@ -38,8 +38,10 @@ def create_item_from_template(doc, extra_fields_to_override=None, translations =
# and apply them if any found
updates = {key: val for key, val in doc.items() if key in fields_to_override}

#override translated values if any
translated_value = {entry["field"]: entry["value"] for entry in translations or [] if entry["language"] == doc.get("language")}
# override translated values if any
translated_value = {
entry["field"]: entry["value"] for entry in translations or [] if entry["language"] == doc.get("language")
}
updates = {key: val for key, val in translated_value.items() if key in fields_to_override}

if len(updates):
Expand Down

0 comments on commit 1e44547

Please sign in to comment.