aboutsummaryrefslogtreecommitdiffstats
path: root/servo
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2016-03-18 11:52:13 +0200
committerFilipp Lepalaan <filipp@mac.com>2016-03-18 11:52:13 +0200
commitf5ae8615a6a53bed91aabbb84276ea891fae9ca7 (patch)
tree231c654206dbd1fae6229466f29feff713621bc6 /servo
parent07600c09b7811b7f963d679467111e3cda4ac726 (diff)
downloadServo-f5ae8615a6a53bed91aabbb84276ea891fae9ca7.tar.gz
Servo-f5ae8615a6a53bed91aabbb84276ea891fae9ca7.tar.bz2
Servo-f5ae8615a6a53bed91aabbb84276ea891fae9ca7.zip
Throw 404 rather than custom error
Diffstat (limited to 'servo')
-rw-r--r--servo/views/order.py7
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: