simpler code - same function

This commit is contained in:
Matthias 2021-05-08 20:53:26 +02:00
parent 9b69980a6c
commit a0d9bf692e

View File

@ -195,7 +195,7 @@ class FileManagementFormView(MultiStepFormView):
def get_context_data(self, form, **kwargs):
context = super().get_context_data(form=form, **kwargs)
if self.steps.current == 'fields' or self.steps.current == 'items':
if self.steps.current in ('fields', 'items'):
# Get columns and row data
self.columns = self.file_manager.columns()
@ -435,7 +435,7 @@ class FileManagementFormView(MultiStepFormView):
}
# Data validation
valid = len(self.extra_context_data.get('missing_columns', [])) == 0 and not self.extra_context_data.get('duplicates', [])
valid = not missing_columns and not duplicates
return valid