fix for form_list

This commit is contained in:
Matthias 2021-06-03 00:29:24 +02:00
parent fc9e1e6770
commit 625d868a3f

View File

@ -127,7 +127,7 @@ class MultiStepFormView(SessionWizardView):
def __init__(self, *args, **kwargs):
""" Override init method to set media folder """
super().__init__(*args, **kwargs)
super().__init__(**kwargs)
self.process_media_folder()
@ -207,6 +207,12 @@ class FileManagementFormView(MultiStepFormView):
if not hasattr(self, 'file_manager_class') and not issubclass(self.file_manager_class, FileManager):
raise NotImplementedError('A subclass of a file manager class needs to be set!')
@classmethod
def get_initkwargs(cls, *args, **kwargs):
# Construct form_list
kwargs['form_list'] = [(key, value) for key, value in cls.forms.items()]
return super().get_initkwargs(*args, **kwargs)
def get_context_data(self, form=None, **kwargs):
if form is None:
form = self.get_form()