From 04f061ccd6a7f64283d2144edafb088b7c3caf30 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Thu, 23 Nov 2017 11:29:14 +0100 Subject: [PATCH] very minor fix --- wtem/management/commands/wtem_generate_keys.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/wtem/management/commands/wtem_generate_keys.py b/wtem/management/commands/wtem_generate_keys.py index 06ea89f..48cd8b2 100644 --- a/wtem/management/commands/wtem_generate_keys.py +++ b/wtem/management/commands/wtem_generate_keys.py @@ -12,14 +12,10 @@ class Command(BaseCommand): 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']: - args[attr] = getattr(confirmation, attr) - Submission.create(**args) - new += 1 - else: - self.stdout.write('skipping ' + confirmation.email + ': already exists.') - skipped += 1 + args = {} + for attr in ['first_name', 'last_name', 'email', 'contact']: + args[attr] = getattr(confirmation, attr) + Submission.create(**args) + new += 1 self.stdout.write('New: ' + str(new) + ', skipped: ' + str(skipped)) -- 2.20.1