From 014e962a3ff52b8a4a251b1f2de5046b17565a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Sun, 19 Aug 2018 00:06:25 +0200 Subject: [PATCH] use .get because it might not be there. --- src/program/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/program/forms.py b/src/program/forms.py index ece0b23b..a8a29ae3 100644 --- a/src/program/forms.py +++ b/src/program/forms.py @@ -182,7 +182,7 @@ class EventProposalForm(forms.ModelForm): self.instance.user = user self.instance.event_type = event_type super().save(commit=True) - if self.cleaned_data['slides_url'] and (self.instance.event_type.name == 'Talk' or self.instance.event_type.name == 'Lightning Talk'): + if self.cleaned_data.get('slides_url') and (self.instance.event_type.name == 'Talk' or self.instance.event_type.name == 'Lightning Talk'): slides_url = Url() slides_url.eventproposal = self.instance slides_url.url = self.cleaned_data['slides_url']