mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-06 05:30:56 +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:
@ -1300,8 +1300,12 @@ class StockItem(MetadataMixin, MPTTModel):
|
||||
item.save()
|
||||
|
||||
@transaction.atomic
|
||||
def copyTestResultsFrom(self, other, filters={}):
|
||||
def copyTestResultsFrom(self, other, filters=None):
|
||||
"""Copy all test results from another StockItem."""
|
||||
# Set default - see B006
|
||||
if filters is None:
|
||||
filters = {}
|
||||
|
||||
for result in other.test_results.all().filter(**filters):
|
||||
|
||||
# Create a copy of the test result by nulling-out the pk
|
||||
|
Reference in New Issue
Block a user