X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/000e4c425eb0f65533002e29e5b1b6ae1e60a77f..06688111dda268136a44ef94d7a7586c0c8eb6ce:/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 1496c7b..06ea89f 100644 --- a/wtem/management/commands/wtem_generate_keys.py +++ b/wtem/management/commands/wtem_generate_keys.py @@ -10,7 +10,8 @@ class Command(BaseCommand): new = 0 skipped = 0 - for confirmation in Confirmation.objects.all(): + emails = list(Submission.objects.values_list('email', flat=True)) + for confirmation in Confirmation.objects.exclude(email__in=emails): if not Submission.objects.filter(email=confirmation.email).exists(): args = {} for attr in ['first_name', 'last_name', 'email', 'contact']: