2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-01 13:06:45 +00:00

Fixed exception for quantity check

This commit is contained in:
eeintech 2021-04-28 16:46:42 -04:00
parent a63d5012f0
commit d072187bf8

View File

@ -342,7 +342,7 @@ class PurchaseOrder(Order):
if quantity < 0: if quantity < 0:
raise ValidationError({"quantity": _("Quantity must be a positive number")}) raise ValidationError({"quantity": _("Quantity must be a positive number")})
quantity = int(quantity) quantity = int(quantity)
except ValueError: except (ValueError, TypeError):
raise ValidationError({"quantity": _("Invalid quantity provided")}) raise ValidationError({"quantity": _("Invalid quantity provided")})
# Create a new stock item # Create a new stock item