From 6af51c5b3500a940fa8c6e323857ffa64e1ca631 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 27 Jun 2019 23:11:54 +1000 Subject: [PATCH] Limit the number of lines returned in row_count --- InvenTree/part/bom.py | 5 ++++- InvenTree/part/templates/part/bom_upload.html | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/InvenTree/part/bom.py b/InvenTree/part/bom.py index 594275b670..6841de2146 100644 --- a/InvenTree/part/bom.py +++ b/InvenTree/part/bom.py @@ -162,7 +162,10 @@ class BomUploadManager: if self.data is None: return 0 - return len(self.data) - self.starting_row + # Limit the number of BOM lines to be sensible + count = min(len(self.data) - self.starting_row, 1000) + + return count def get_row(self, index): """ Retrieve a dict object representing the data row at a particular offset """ diff --git a/InvenTree/part/templates/part/bom_upload.html b/InvenTree/part/templates/part/bom_upload.html index b62cbc9c49..50ff5cdf87 100644 --- a/InvenTree/part/templates/part/bom_upload.html +++ b/InvenTree/part/templates/part/bom_upload.html @@ -8,6 +8,10 @@

The BOM file must contain the required named columns as provided in the BOM Upload Template

-

Supported file formats: .csv, .tsv, .xls, .xlsx

+Notes: + {% endblock %} \ No newline at end of file