From f5ae8615a6a53bed91aabbb84276ea891fae9ca7 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Fri, 18 Mar 2016 11:52:13 +0200 Subject: Throw 404 rather than custom error --- servo/views/order.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'servo') diff --git a/servo/views/order.py b/servo/views/order.py index 3b3930a..b4838f7 100644 --- a/servo/views/order.py +++ b/servo/views/order.py @@ -664,12 +664,7 @@ def edit_product(request, pk, item_id): Edits a product added to an order """ order = Order.objects.get(pk=pk) - - try: - item = ServiceOrderItem.objects.get(pk=item_id) - except ServiceOrderItem.DoesNotExist: - messages.error(request, _('Product not found in order')) - return redirect(order) + item = get_object_or_404(ServiceOrderItem, pk=item_id) if not item.kbb_sn and item.product.part_type == "REPLACEMENT": try: -- cgit v1.2.3