Limit the number of lines returned in row_count

This commit is contained in:
Oliver Walters 2019-06-27 23:11:54 +10:00
parent c4944268f3
commit 6af51c5b35
2 changed files with 9 additions and 2 deletions

View File

@ -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 """

View File

@ -8,6 +8,10 @@
<p>The BOM file must contain the required named columns as provided in the <a href="/part/bom_template/">BOM Upload Template</a></a></p>
<p>Supported file formats: <i>.csv, .tsv, .xls, .xlsx</i></p>
<b>Notes:</b>
<ul>
<li>Supported file formats: <i>.csv, .tsv, .xls, .xlsx</li>
<li>Maximum of 1000 lines per BOM</li>
</ul>
{% endblock %}