diff options
Diffstat (limited to 'servo')
-rw-r--r-- | servo/views/order.py | 7 |
1 files changed, 1 insertions, 6 deletions
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: |