def order_detail(request, order_min_id): order = Order.get_or_none(order_min_id) if order is None: raise Http404("Order with ID `{}` not found".format(order_min_id)) context = {"order": order} return render(request, "order.html", context)
def order_detail(request, order_min_id): order = Order.get_or_none(order_min_id) if order is None: raise Http404( _("Order with ID `%(order_id)s` not found") % {"order_id": order_min_id}) context = {"order": order} return render(request, "order.html", context)
def order_cancel(request, order_min_id): order = Order.get_or_none(order_min_id) if order is None: raise Http404("Order with ID `{}` not found".format(order_min_id)) if order.cancel(): messages.success(request, "Successfuly canceled order #{}".format(order_min_id)) else: messages.error(request, "Unable to cancel order #{}".format(order_min_id)) return redirect("order_detail", order_min_id=order.min_id)
def order_cancel(request, order_min_id): order = Order.get_or_none(order_min_id) if order is None: raise Http404( _("Order with ID `%(order_id)s` not found") % {"order_id": order_min_id}) if order.cancel(): messages.success( request, _("Successfuly canceled order #%(order_id)s") % {"order_id": order_min_id}, ) else: messages.error( request, _("Unable to cancel order #%(order_id)s") % {"order_id": order_min_id}, ) return redirect("order_detail", order_min_id=order.min_id)