mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-28 10:52:16 +00:00
Merge pull request #324 from nottinghamtec/hotfix/auth-request
Fix null person on authorisation request
This commit is contained in:
@@ -340,8 +340,10 @@ class EventAuthorisationRequest(generic.FormView, generic.detail.SingleObjectMix
|
|||||||
'sent_by': self.request.user.pk,
|
'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
|
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(
|
msg = EmailMultiAlternatives(
|
||||||
"N%05d | %s - Event Authorisation Request" % (self.object.pk, self.object.name),
|
"N%05d | %s - Event Authorisation Request" % (self.object.pk, self.object.name),
|
||||||
|
|||||||
Reference in New Issue
Block a user