From 36f0acffb463ef5d1a85f0e0e9d01856f35b0fb1 Mon Sep 17 00:00:00 2001 From: Ihsan Ullah Date: Thu, 2 Apr 2026 04:41:05 +0500 Subject: [PATCH] use submission queue when cancelling --- src/apps/competitions/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/apps/competitions/models.py b/src/apps/competitions/models.py index 8477e1c62..34e739e5d 100644 --- a/src/apps/competitions/models.py +++ b/src/apps/competitions/models.py @@ -674,8 +674,10 @@ def cancel(self, status=CANCELLED): sub.cancel(status=status) celery_app = app # If a custom queue is set, we need to fetch the appropriate celery app - if self.phase.competition.queue: - celery_app = app_for_vhost(str(self.phase.competition.queue.vhost)) + # NOTE: We fetch the queue from submission and not from competition to be sure that we are using the correct queue + # Originally we were using queue from the competition (self.phase.competition.queue) + if self.queue: + celery_app = app_for_vhost(str(self.queue.vhost)) # We need to convert the UUID given by celery into a byte like object otherwise it won't work celery_app.control.revoke(str(self.celery_task_id), terminate=True) self.status = status