From 7607cc9dfaf572481e6cf40f18a3e5a2e2761297 Mon Sep 17 00:00:00 2001 From: gmplab Date: Thu, 18 May 2017 15:11:19 +0800 Subject: [PATCH] try to fix #997 ,when cart is disabled, it will not show error and it will dedirect to 'contact' page (#8636) --- erpnext/shopping_cart/cart.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index 61ec78c6516..66e9f4ce244 100644 --- a/erpnext/shopping_cart/cart.py +++ b/erpnext/shopping_cart/cart.py @@ -315,7 +315,8 @@ def get_party(user=None): else: if not cart_settings.enabled: - return None + frappe.local.flags.redirect_location = "/contact" + raise frappe.Redirect customer = frappe.new_doc("Customer") fullname = get_fullname(user) customer.update({