Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/apps/competitions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down