Skip to content

Commit dcb58c2

Browse files
authored
Merge pull request #2310 from codalab/cancel_submission
Cancel Submission - use submission queue instead of competition queue
2 parents 21b7515 + 36f0acf commit dcb58c2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/apps/competitions/models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,10 @@ def cancel(self, status=CANCELLED):
674674
sub.cancel(status=status)
675675
celery_app = app
676676
# If a custom queue is set, we need to fetch the appropriate celery app
677-
if self.phase.competition.queue:
678-
celery_app = app_for_vhost(str(self.phase.competition.queue.vhost))
677+
# NOTE: We fetch the queue from submission and not from competition to be sure that we are using the correct queue
678+
# Originally we were using queue from the competition (self.phase.competition.queue)
679+
if self.queue:
680+
celery_app = app_for_vhost(str(self.queue.vhost))
679681
# We need to convert the UUID given by celery into a byte like object otherwise it won't work
680682
celery_app.control.revoke(str(self.celery_task_id), terminate=True)
681683
self.status = status

0 commit comments

Comments
 (0)