From ca87cef8d5e02b70b675974836a091c840bdcd02 Mon Sep 17 00:00:00 2001
From: Jorran de Wit <jorrandewit@outlook.com>
Date: Sat, 4 Nov 2017 21:43:57 +0100
Subject: [PATCH] Fix submission query

---
 submissions/views.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/submissions/views.py b/submissions/views.py
index a9824dbd6..a8d12ce41 100644
--- a/submissions/views.py
+++ b/submissions/views.py
@@ -995,7 +995,7 @@ def cancel_ref_invitation(request, arxiv_identifier_w_vn_nr, invitation_id):
     """
     try:
         submissions = Submission.objects.filter_for_eic(request.user)
-        invitation = submissions.referee_invitations.get(pk=invitation_id)
+        invitation = RefereeInvitation.objects.get(submission__in=submissions, pk=invitation_id)
     except RefereeInvitation.DoesNotExist:
         raise Http404
 
-- 
GitLab