X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/ecf1bb43a75eeacf9dbec78fd6f5a1d3d526dbd8..6de9bcf51b42077e9628c4ad4d0e06a6932e7aa0:/wtem/management/commands/wtem_generate_keys.py

diff --git a/wtem/management/commands/wtem_generate_keys.py b/wtem/management/commands/wtem_generate_keys.py
index 0fc537b..8a14ff9 100644
--- a/wtem/management/commands/wtem_generate_keys.py
+++ b/wtem/management/commands/wtem_generate_keys.py
@@ -10,7 +10,7 @@ class Command(BaseCommand):
         new = 0
         skipped = 0
 
-        for wtem_contact in Contact.objects.filter(form_tag = 'wtem'):
+        for wtem_contact in Contact.objects.filter(form_tag = 'wtem').order_by('-created_at'):
             for student in wtem_contact.body['student']:
                 if not Submission.objects.filter(email = student['email']).exists():
                     args = dict()