From: Aleksander Ɓukasz Date: Thu, 21 Nov 2013 16:48:20 +0000 (+0100) Subject: Sort submission on assignment X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/ff329ff2ca2c8b53e9ce8cc7283bc82bf1483e5d?ds=inline;hp=-c Sort submission on assignment --- ff329ff2ca2c8b53e9ce8cc7283bc82bf1483e5d 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))