diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index aa5727c..cedcc73 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/views.py b/core/views.py index 4525723..20a38a4 100644 --- a/core/views.py +++ b/core/views.py @@ -33,12 +33,13 @@ def upload_inventory(request): # Skip header row next(reader) for row in reader: - print(f"Processing row: {row}") - Application.objects.create( - name=row[0], - version=row[1], - vendor=row[2], - ) + if row and len(row) == 3: + print(f"Processing row: {row}") + Application.objects.create( + name=row[0], + version=row[1], + vendor=row[2], + ) return redirect('dashboard') except Exception as e: print(f"An error occurred: {e}")