From 72009317f87edd35078c89d600c45b0d60c5771d Mon Sep 17 00:00:00 2001 From: marwoodandrew Date: Thu, 10 Aug 2023 12:19:43 +1000 Subject: [PATCH] SDAAP-83 Update to a story published with Crops not matching the image --- apps/archive/archive.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/archive/archive.py b/apps/archive/archive.py index 9bab997751..20dd6765fa 100644 --- a/apps/archive/archive.py +++ b/apps/archive/archive.py @@ -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: