mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Handle dimension error in tablib
This commit is contained in:
parent
482a5dae4b
commit
322710d603
@ -95,6 +95,8 @@ class BomUploadManager:
|
||||
self.data = tablib.Dataset().load(raw_data)
|
||||
except tablib.UnsupportedFormat:
|
||||
raise ValidationError({'bom_file': _('Error reading BOM file (invalid data)')})
|
||||
except tablib.core.InvalidDimensions:
|
||||
raise ValidationError({'bom_file': _('Error reading BOM file (incorrect row size)')})
|
||||
|
||||
def guess_header(self, header, threshold=80):
|
||||
""" Try to match a header (from the file) to a list of known headers
|
||||
|
@ -782,7 +782,6 @@ class BomUpload(FormView):
|
||||
self.extractDataFromFile(manager)
|
||||
else:
|
||||
form = self.form
|
||||
form.errors['bom_file'] = [_('no errors')]
|
||||
|
||||
return self.render_to_response(self.get_context_data(form=form))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user