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

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