diff --git a/server/aap/macros/abs_indicators.py b/server/aap/macros/abs_indicators.py index d7d92893b..4ffbb1543 100644 --- a/server/aap/macros/abs_indicators.py +++ b/server/aap/macros/abs_indicators.py @@ -15,6 +15,8 @@ import time import logging from flask import render_template_string +from superdesk import get_resource_service +from superdesk.utils import config cpi_url = 'CPI/2.50.999901.20.Q' cpi_token = '__CPI__' @@ -136,6 +138,15 @@ def abs_expand(item, **kwargs): except Exception as ex: logger.warning(ex) + # If the macro is being executed by a stage macro then update the item directly + if 'desk' in kwargs and 'stage' in kwargs: + update = {'body_html': item.get('body_html', ''), + 'abstract': item.get('abstract', ''), + 'headline': item.get('headline', '')} + get_resource_service('archive').system_update(item[config.ID_FIELD], update, item) + + return get_resource_service('archive').find_one(req=None, _id=item[config.ID_FIELD]) + return item