From f4780d18f68d0608ae164a84f6f530dd0e2d35d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 21 Nov 2013 17:36:13 +0100 Subject: [PATCH] Do not assign submissions without answers --- wtem/management/commands/wtem_assign_submissions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wtem/management/commands/wtem_assign_submissions.py b/wtem/management/commands/wtem_assign_submissions.py index f87b7f4..2ec816e 100644 --- a/wtem/management/commands/wtem_assign_submissions.py +++ b/wtem/management/commands/wtem_assign_submissions.py @@ -16,7 +16,7 @@ class Command(BaseCommand): submissions_query = Submission.objects.annotate(examiners_count = Count('examiners')) submissions = submissions_query \ - .filter(examiners_count__lt=2)[0:how_many] + .filter(examiners_count__lt=2).exclude(answers = None)[0:how_many] for submission in submissions: submission.examiners.add(*users) -- 2.20.1