mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 03:00:54 +00:00
Add more checks to pre-commit (#3132)
* Add bandit to pre-commit checks * fix catchall exceptions * remove unused definitons * remove unuseed ariables * Add docstring * fix B006, B008 errors * fix B007 error * ignore B009 * Add checks for formatting and naming
This commit is contained in:
@ -902,7 +902,7 @@ class BomImportExtractSerializer(DataFileExtractSerializer):
|
||||
if level != 1:
|
||||
# Skip this row
|
||||
return None
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Attempt to extract a valid part based on the provided data
|
||||
@ -954,7 +954,7 @@ class BomImportExtractSerializer(DataFileExtractSerializer):
|
||||
|
||||
if quantity <= 0:
|
||||
row['errors']['quantity'] = _('Quantity must be greater than zero')
|
||||
except:
|
||||
except Exception:
|
||||
row['errors']['quantity'] = _('Invalid quantity')
|
||||
|
||||
return row
|
||||
|
Reference in New Issue
Block a user