Enforce step order of event creation wizard

This commit is contained in:
Raphael Michel
2017-11-22 12:09:26 +01:00
parent 2a3adb135b
commit 8d8eb5d13b

View File

@@ -118,6 +118,14 @@ class EventWizard(SessionWizardView):
ctx['organizer'] = self.get_cleaned_data_for_step('foundation').get('organizer')
return ctx
def render(self, form=None, **kwargs):
if self.steps.current != 'foundation':
fdata = self.get_cleaned_data_for_step('foundation')
if fdata is None:
return self.render_goto_step('foundation')
return super().render(form, **kwargs)
def get_form_kwargs(self, step=None):
kwargs = {
'user': self.request.user