Catch IndexError when importing data (#5439) (#5443)

* Catch IndexError when importing data

* Also handle TypeError

(cherry picked from commit 93e4dadb49)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
github-actions[bot] 2023-08-14 15:39:07 +10:00 committed by GitHub
parent 3b238fdbba
commit b8e726d8a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,7 +168,11 @@ class PartImport(FileManagementFormView):
for row in self.rows:
# check each submitted column
for idx in col_ids:
data = row['data'][col_ids[idx]]['cell']
try:
data = row['data'][col_ids[idx]]['cell']
except (IndexError, TypeError):
continue
if idx in self.file_manager.OPTIONAL_MATCH_HEADERS:
try: