use event_type from last event from the loop, fix backtrace when updating a speakerproposal which has more than one eventproposal of the same type

This commit is contained in:
Thomas Steen Rasmussen 2019-07-16 10:35:19 +02:00
parent 5fa07f130a
commit 939d17c8bd
1 changed files with 2 additions and 1 deletions

View File

@ -212,7 +212,8 @@ class SpeakerProposalUpdateView(
for ep in self.get_object().eventproposals.all():
eventtypes.add(ep.event_type)
if len(eventtypes) == 1:
eventtype = self.get_object().eventproposals.get().event_type
# only one eventtype found
eventtype = ep.event_type
else:
# more than one type of event for this person, return the generic speakerproposal form
eventtype = None