From ff329ff2ca2c8b53e9ce8cc7283bc82bf1483e5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 21 Nov 2013 17:48:20 +0100 Subject: [PATCH] Sort submission on assignment --- 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 6d33ec8..fad2d3e 100644 --- a/wtem/management/commands/wtem_assign_submissions.py +++ b/wtem/management/commands/wtem_assign_submissions.py @@ -33,7 +33,7 @@ class Command(BaseCommand): with_attachment_ids = Attachment.objects.values_list('submission_id', flat=True).all() submissions = submissions.filter(id__in = with_attachment_ids) - for submission in submissions[0:how_many]: + for submission in submissions.order_by('id')[0:how_many]: submission.examiners.add(*users) submission.save() self.stdout.write('added to %s:%s' % (submission.id, submission.email)) -- 2.20.1