2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-04 14:28:48 +00:00

Enhance exception management (#8174)

This commit is contained in:
Oliver 2024-09-24 21:47:36 +10:00 committed by GitHub
parent 0f2cfdcfd4
commit 6d0353028f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -353,7 +353,8 @@ class LineItemPricing(PartPricing):
try: try:
part_id = self.request.POST.get('pk') part_id = self.request.POST.get('pk')
part = Part.objects.get(id=part_id) part = Part.objects.get(id=part_id)
except Part.DoesNotExist: except Exception:
# Part not found, or invalid ID
return None return None
else: else:
return None return None