From 099c2610e60a50f3dd71bef025ba461129ac97e1 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 9 May 2018 15:12:25 +0100 Subject: [PATCH] ignore unknown tasks --- pandora/taskqueue/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora/taskqueue/views.py b/pandora/taskqueue/views.py index c765f35b8..49c2ef9c7 100644 --- a/pandora/taskqueue/views.py +++ b/pandora/taskqueue/views.py @@ -44,7 +44,10 @@ def cancelTask(request, data): if not isinstance(ids, list): ids = [ids] for id in ids: - task = models.Task.get(id) + try: + task = models.Task.get(id) + except models.Task.DoesNotExist: + continue if task.user != request.user and not request.user.profile.capability('canSeeAllTasks'): response = json_response(status=403, text='permission denied') return render_to_json_response(response)