fix for deleting items

in step 2 not working in step 3
This commit is contained in:
Matthias 2021-05-08 21:05:02 +02:00
parent 5622468209
commit 89e0856824

View File

@ -333,20 +333,34 @@ class FileManagementFormView(MultiStepFormView):
'errors': {},
})
else:
if self.column_names:
rows_shown = []
# Update the row data
for row in self.rows:
row_data = row['data']
data = []
show_data = []
for idx, item in enumerate(row_data):
data.append({
column_data ={
'cell': item,
'idx': idx,
'column': self.columns[idx],
})
}
data.append(column_data)
if not self.column_names or self.columns[idx]['name'] in self.column_names:
show_data.append(column_data)
row['data'] = data
if self.column_names:
current_row = row
current_row['data'] = show_data
rows_shown.append(current_row)
if self.column_names and self.get_step_index() == 3:
self.rows = rows_shown
# In the item selection step: update row data to contain fields
if form and self.steps.current == 'items':