From a20eb468df177c464899897026e13d8054d8091f Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 14 Aug 2022 15:53:43 -0500 Subject: [PATCH] Redirect to custom index URL when user cancels new custorder entry --- tailbone/views/custorders/orders.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tailbone/views/custorders/orders.py b/tailbone/views/custorders/orders.py index 50a108ef..41f7c5f5 100644 --- a/tailbone/views/custorders/orders.py +++ b/tailbone/views/custorders/orders.py @@ -410,8 +410,7 @@ class CustomerOrderView(MasterView): self.request.session.flash("New customer order has been deleted.") # send user back to customer orders page, w/ no new batch generated - route_prefix = self.get_route_prefix() - url = self.request.route_url(route_prefix) + url = self.get_index_url() return self.redirect(url) def customer_autocomplete(self): @@ -1005,5 +1004,12 @@ class CustomerOrderView(MasterView): CustomerOrdersView = CustomerOrderView -def includeme(config): +def defaults(config, **kwargs): + base = globals() + + CustomerOrderView = kwargs.get('CustomerOrderView', base['CustomerOrderView']) CustomerOrderView.defaults(config) + + +def includeme(config): + defaults(config)