From b7874157f7e84ba70aae325b926208d2157632ee Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 29 May 2019 15:15:59 +0530 Subject: [PATCH] refactor: /lms redirects to home if lms is disbaled --- erpnext/www/lms/index.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/www/lms/index.py b/erpnext/www/lms/index.py index 99dcb651aa1..15ca0b46287 100644 --- a/erpnext/www/lms/index.py +++ b/erpnext/www/lms/index.py @@ -6,6 +6,9 @@ no_cache = 1 def get_context(context): context.education_settings = frappe.get_single("Education Settings") + if not context.education_settings.enable_lms: + frappe.local.flags.redirect_location = '/' + raise frappe.Redirect context.featured_programs = get_featured_programs()