From 9fe603b08813a2a0f95a5f2db702dac66adb4e15 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 27 May 2016 12:16:40 +0200 Subject: Check that an action available and redirect --- chimere/forms.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'chimere/forms.py') diff --git a/chimere/forms.py b/chimere/forms.py index e9239a0..e17e3c9 100644 --- a/chimere/forms.py +++ b/chimere/forms.py @@ -296,8 +296,7 @@ class MarkerAdminFormBase(forms.ModelForm): self.fields['end_date'].widget = DatePickerWidget() if subcategories: self.fields['categories'].choices = subcategories - elif hasattr(self, 'categories_choices'): - self.fields['categories'].choices = self.categories_choices + self.fields['categories'].choices = [] # auto select if there is only one category choices = list(self.fields['categories'].choices) self.fields['categories'].choices = choices -- cgit v1.2.3