From a0d9bf692ed5e41fb03b22578e6acf0423e9dced Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 8 May 2021 20:53:26 +0200 Subject: [PATCH] simpler code - same function --- InvenTree/common/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/common/views.py b/InvenTree/common/views.py index 1e54663862..a7515c0529 100644 --- a/InvenTree/common/views.py +++ b/InvenTree/common/views.py @@ -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