From 939d17c8bd6d797c4d28d91ef3d7f70b4f24f316 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Tue, 16 Jul 2019 10:35:19 +0200 Subject: [PATCH] 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 --- src/program/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/program/views.py b/src/program/views.py index bf9013fc..166ea5cf 100644 --- a/src/program/views.py +++ b/src/program/views.py @@ -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