Skip to content

Commit

Permalink
Publish from Superdesk to Newshub fails when article is linked to a c…
Browse files Browse the repository at this point in the history
…overage (#1156)
  • Loading branch information
marwoodandrew authored Feb 7, 2022
1 parent 9a854f7 commit 09f87bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 9 additions & 4 deletions newsroom/push.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,15 @@ def publish_item(doc, original):
if app.generate_embed_renditions:
app.generate_embed_renditions(doc)

if doc.get('coverage_id'):
agenda_items = superdesk.get_resource_service('agenda').set_delivery(doc)
if agenda_items:
[notify_new_item(item, check_topics=False) for item in agenda_items]
try:
if doc.get('coverage_id'):
agenda_items = superdesk.get_resource_service('agenda').set_delivery(doc)
if agenda_items:
[notify_new_item(item, check_topics=False) for item in agenda_items]
except Exception as ex:
logger.info('Failed to notify new wire item for Agenda watches')
logger.exception(ex)

publish_item_signal.send(app._get_current_object(), item=doc, is_new=original is None)
_id = service.create([doc])[0]
if 'associations' not in doc and original is not None and bool(original.get('associations', {})):
Expand Down
4 changes: 2 additions & 2 deletions newsroom/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ def date_short(datetime):


def get_agenda_dates(agenda, date_paranthesis=False):
start = agenda.get('dates', {}).get('start')
end = agenda.get('dates', {}).get('end')
start = parse_date_str(agenda.get('dates', {}).get('start'))
end = parse_date_str(agenda.get('dates', {}).get('end'))

if start + timedelta(minutes=DAY_IN_MINUTES) < end:
# Multi day event
Expand Down

0 comments on commit 09f87bf

Please sign in to comment.