Skip to content

Commit

Permalink
SDAAP-83 Update to a story published with Crops not matching the image
Browse files Browse the repository at this point in the history
  • Loading branch information
marwoodandrew committed Aug 10, 2023
1 parent 6784c03 commit 7200931
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/archive/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,13 @@ def _handle_media_updates(self, updates, original, user):

item_id = item_obj[config.ID_FIELD]
media_item = self.find_one(req=None, _id=item_id)
if app.settings.get("COPY_METADATA_FROM_PARENT") and item_obj.get(ITEM_TYPE) in MEDIA_TYPES:
stored_item = (original.get(ASSOCIATIONS) or {}).get(item_name) or item_obj
parent = (original.get(ASSOCIATIONS) or {}).get(item_name) or item_obj
if (
app.settings.get("COPY_METADATA_FROM_PARENT")
and item_obj.get(ITEM_TYPE) in MEDIA_TYPES
and item_id == parent.get(config.ID_FIELD)
):
stored_item = parent
else:
stored_item = media_item
if not stored_item:
Expand Down

0 comments on commit 7200931

Please sign in to comment.