- for contact_id, submissions in submissions_by_contact.items():
- contact = Contact.objects.get(id=contact_id)
- message = render_to_string('wtem/results_teacher.txt', dict(submissions = submissions))
- self.send_message(message, subject, contact.contact)
+ for contact_email, submissions in submissions_by_contact.items():
+ message = render_to_string('wtem/results_teacher.txt', dict(submissions=submissions))
+ self.send_message(message, subject, contact_email)