From: Aleksander Ɓukasz Date: Thu, 21 Nov 2013 16:36:13 +0000 (+0100) Subject: Do not assign submissions without answers X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/f4780d18f68d0608ae164a84f6f530dd0e2d35d2?ds=sidebyside;hp=-c Do not assign submissions without answers --- f4780d18f68d0608ae164a84f6f530dd0e2d35d2 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)