Skip to content

Commit 5acd936

Browse files
committed
use uuid
Signed-off-by: tdruez <tdruez@aboutcode.org>
1 parent 3acdf10 commit 5acd936

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

notification/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def fire_webhooks(
158158
webhooks = WebhookSubscription.objects.scope(dataspace).filter(**filters)
159159

160160
for webhook in webhooks:
161-
task_kwargs = {"webhook_subscription_pk": webhook.pk}
161+
task_kwargs = {"webhook_subscription_uuid": webhook.uuid}
162162
if payload_override is not None:
163163
task_kwargs["payload_override"] = payload_override
164164
if instance is not None:

notification/tasks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919

2020
@job
2121
def deliver_webhook_task(
22-
webhook_subscription_pk,
22+
webhook_subscription_uuid,
2323
payload_override=None,
2424
instance_app_label=None,
2525
instance_model_name=None,
2626
instance_pk=None,
2727
):
2828
"""Deliver a webhook payload to the target URL of the given WebhookSubscription."""
2929
try:
30-
webhook_subscription = WebhookSubscription.objects.get(pk=webhook_subscription_pk)
30+
webhook_subscription = WebhookSubscription.objects.get(uuid=webhook_subscription_uuid)
3131
except WebhookSubscription.DoesNotExist:
32-
logger.error(f"WebhookSubscription pk={webhook_subscription_pk} not found.")
32+
logger.error(f"WebhookSubscription uuid={webhook_subscription_uuid} not found.")
3333
return
3434

3535
instance = None

0 commit comments

Comments
 (0)