fix: move enable check to serverside
diff --git a/erpnext/www/book-appointment/index.js b/erpnext/www/book-appointment/index.js
index 07355e1..cfacc79 100644
--- a/erpnext/www/book-appointment/index.js
+++ b/erpnext/www/book-appointment/index.js
@@ -1,14 +1,4 @@
 frappe.ready(async () => {
-    debugger
-    let isSchedulingEnabled = await frappe.call({
-        method:'erpnext.www.book-appointment.index.is_enabled'
-    })
-    isSchedulingEnabled  = isSchedulingEnabled.message
-    if (!isSchedulingEnabled) {
-        frappe.show_alert("This feature is not enabled");
-        window.location.replace('/');
-        return;
-    }
     initialise_select_date();
 })
 
diff --git a/erpnext/www/book-appointment/index.py b/erpnext/www/book-appointment/index.py
index a810a2b..1a9afa5 100644
--- a/erpnext/www/book-appointment/index.py
+++ b/erpnext/www/book-appointment/index.py
@@ -9,6 +9,12 @@
 
 no_cache = 1
 
+def get_context(context):
+    is_enabled = frappe.db.get_single_value('Appointment Booking Settings','enable_scheduling')
+    if is_enabled:
+        return context
+    else:
+        raise frappe.DoesNotExistError
 
 @frappe.whitelist(allow_guest=True)
 def get_appointment_settings():