2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-11 07:24:15 +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:
Matthias Mair
2022-06-06 00:56:52 +02:00
committed by GitHub
parent bbbfd003e0
commit f38386b13c
56 changed files with 154 additions and 109 deletions

View File

@ -606,7 +606,7 @@ class PartCopyBOM(generics.CreateAPIView):
try:
ctx['part'] = Part.objects.get(pk=self.kwargs.get('pk', None))
except:
except Exception:
pass
return ctx
@ -1042,12 +1042,12 @@ class PartList(APIDownloadMixin, generics.ListCreateAPIView):
try:
manufacturer = Company.objects.get(pk=request.data.get('manufacturer', None))
except:
except Exception:
manufacturer = None
try:
supplier = Company.objects.get(pk=request.data.get('supplier', None))
except:
except Exception:
supplier = None
mpn = str(request.data.get('MPN', '')).strip()