mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-30 18:50: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:
@ -295,7 +295,7 @@ class PurchaseOrderContextMixin:
|
||||
# Pass the purchase order through to the serializer for validation
|
||||
try:
|
||||
context['order'] = models.PurchaseOrder.objects.get(pk=self.kwargs.get('pk', None))
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
context['request'] = self.request
|
||||
@ -857,7 +857,7 @@ class SalesOrderContextMixin:
|
||||
|
||||
try:
|
||||
ctx['order'] = models.SalesOrder.objects.get(pk=self.kwargs.get('pk', None))
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return ctx
|
||||
@ -1050,7 +1050,7 @@ class SalesOrderShipmentComplete(generics.CreateAPIView):
|
||||
ctx['shipment'] = models.SalesOrderShipment.objects.get(
|
||||
pk=self.kwargs.get('pk', None)
|
||||
)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return ctx
|
||||
|
Reference in New Issue
Block a user