mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-12 23:00:53 +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:
@@ -363,7 +363,7 @@ class StockLocationLabelList(LabelListView, StockLocationLabelMixin):
|
||||
# Filter string defined for the StockLocationLabel object
|
||||
try:
|
||||
filters = InvenTree.helpers.validateFilterString(label.filters)
|
||||
except: # pragma: no cover
|
||||
except Exception: # pragma: no cover
|
||||
# Skip if there was an error validating the filters...
|
||||
continue
|
||||
|
||||
|
@@ -22,8 +22,12 @@ class TestReportTests(InvenTreeAPITestCase):
|
||||
|
||||
list_url = reverse('api-stockitem-testreport-list')
|
||||
|
||||
def do_list(self, filters={}):
|
||||
def do_list(self, filters=None):
|
||||
"""Helper function to request list of labels with provided filters"""
|
||||
# Set default - see B006
|
||||
if filters is None:
|
||||
filters = {}
|
||||
|
||||
response = self.client.get(self.list_url, filters, format='json')
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
Reference in New Issue
Block a user