Fix null person on authorisation request

Will close #319
This commit is contained in:
Johnathan Graydon
2018-03-12 17:16:50 +00:00
committed by David Taylor
parent 05feb7df1c
commit 7dff951f28

View File

@@ -340,8 +340,10 @@ class EventAuthorisationRequest(generic.FormView, generic.detail.SingleObjectMix
'sent_by': self.request.user.pk,
}),
}
if email == event.person.email:
if event.person is not None and email == event.person.email:
context['to_name'] = event.person.name
elif event.organisation is not None and email == event.organisation.email:
context['to_name'] = event.organisation.name
msg = EmailMultiAlternatives(
"N%05d | %s - Event Authorisation Request" % (self.object.pk, self.object.name),