Event creation UX: Pre-choose organizer if there is only one

This commit is contained in:
Raphael Michel
2017-10-05 08:01:22 +02:00
parent f074e642ec
commit a27f372785

View File

@@ -46,6 +46,8 @@ class EventWizardFoundationForm(forms.Form):
empty_label=None,
required=True
)
if len(self.fields['organizer'].choices) == 1:
self.fields['organizer'].initial = self.fields['organizer'].queryset.first()
class EventWizardBasicsForm(I18nModelForm):