Skip to content

Commit

Permalink
Merge pull request #834 from ZeitOnline/WCM-268_bug
Browse files Browse the repository at this point in the history
WCM-268: Unfortunately celery does not want
  • Loading branch information
stollero authored Aug 26, 2024
2 parents df7e708 + 9e3e97e commit ef670eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/docs/changelog/WCM-268.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WCM-268: Celery must search for the hook object itself
5 changes: 3 additions & 2 deletions core/src/zeit/cms/checkout/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def create_webhook_job(id, context, **kwargs):
id.capitalize(),
context.uniqueId,
)
notify_webhook.apply_async((context.uniqueId, hook), **kwargs)
notify_webhook.apply_async((context.uniqueId, id), **kwargs)


@grok.subscribe(zeit.cms.interfaces.ICMSContent, zeit.cms.checkout.interfaces.IAfterCheckinEvent)
Expand Down Expand Up @@ -58,11 +58,12 @@ def notify_after_add(event):


@zeit.cms.celery.task(bind=True, queue='webhook')
def notify_webhook(self, uniqueId, hook):
def notify_webhook(self, uniqueId, id):
content = zeit.cms.interfaces.ICMSContent(uniqueId, None)
if content is None:
log.warning('Could not resolve %s, ignoring.', uniqueId)
return
hook = HOOKS.factory.find(id)
if hook is None:
log.warning('Hook configuration for %s has vanished, ignoring.', hook.id)
return
Expand Down

0 comments on commit ef670eb

Please sign in to comment.