From ccde53f97f9444d501314061bc99c79bd8f7a728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89lie=20Bouttier?= Date: Thu, 12 Oct 2017 22:51:44 +0200 Subject: [PATCH] fix talk edition by speakers --- cfp/forms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cfp/forms.py b/cfp/forms.py index e2abba2..279cb22 100644 --- a/cfp/forms.py +++ b/cfp/forms.py @@ -39,10 +39,10 @@ class TalkForm(forms.ModelForm): def __init__(self, *args, **kwargs): categories = kwargs.pop('categories') super().__init__(*args, **kwargs) - if categories.exists(): - self.fields['category'].queryset = categories - else: + if kwargs.get('instance', None): del self.fields['category'] + else: + self.fields['category'].queryset = categories class Meta: model = Talk