submissions_by_contact.setdefault(submission.contact.id, []).append(submission)
for contact_id, submissions in submissions_by_contact.items():
submissions_by_contact.setdefault(submission.contact.id, []).append(submission)
for contact_id, submissions in submissions_by_contact.items():