mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
fix for form_list
This commit is contained in:
parent
fc9e1e6770
commit
625d868a3f
@ -127,7 +127,7 @@ class MultiStepFormView(SessionWizardView):
|
|||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
""" Override init method to set media folder """
|
""" Override init method to set media folder """
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
self.process_media_folder()
|
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):
|
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!')
|
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):
|
def get_context_data(self, form=None, **kwargs):
|
||||||
if form is None:
|
if form is None:
|
||||||
form = self.get_form()
|
form = self.get_form()
|
||||||
|
Loading…
Reference in New Issue
Block a user