From 1498e46302d54ae997914ae3bc86b981870bc37f Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Wed, 20 Nov 2013 18:44:11 +0530 Subject: [PATCH] Fix: Added try/catch to product delete as it would bork at times deleting products where narration would exceed the field length --- brewman/views/product.py | 1 + 1 file changed, 1 insertion(+) diff --git a/brewman/views/product.py b/brewman/views/product.py index 1924584d..9c38255c 100644 --- a/brewman/views/product.py +++ b/brewman/views/product.py @@ -56,6 +56,7 @@ def update(request): @view_config(request_method='DELETE', route_name='api_product_id', renderer='json', permission='Products') +@TryCatchFunction def delete(request): product = Product.by_id(uuid.UUID(request.matchdict['id'])) can_delete, reason = product.can_delete('Advanced Delete' in groupfinder(authenticated_userid(request), request))