Tried to capture an error in purchase form where no ProductID key maybe locked the whole app on webfaction.
This commit is contained in:
parent
bb1858fe88
commit
6bbf79a1db
@ -25,6 +25,8 @@ def purchase_create_voucher(json, user):
|
||||
|
||||
|
||||
def purchase_create_inventory(voucher, item, date):
|
||||
if 'Product' not in item or 'ProductID' not in item['Product']:
|
||||
raise ValidationError('No Product in item')
|
||||
product = Product.by_id(uuid.UUID(item['Product']['ProductID']))
|
||||
inventory_id = uuid.UUID(item['InventoryID']) if 'InventoryID' in item else None
|
||||
quantity = round(Decimal(item['Quantity']), 2)
|
||||
|
Loading…
Reference in New Issue
Block a user