1 # -*- coding: utf-8 -*-
2 from django.core.management.base import BaseCommand
4 from wtem.models import Submission, Confirmation
7 class Command(BaseCommand):
9 def handle(self, **options):
13 emails = list(Submission.objects.values_list('email', flat=True))
14 for confirmation in Confirmation.objects.exclude(email__in=emails):
16 for attr in ['first_name', 'last_name', 'email', 'contact']:
17 args[attr] = getattr(confirmation, attr)
18 Submission.create(**args)
21 self.stdout.write('New: ' + str(new) + ', skipped: ' + str(skipped))