fix: move enable check to serverside
This commit is contained in:
parent
faf39ecef4
commit
9e36a9ee04
@ -1,14 +1,4 @@
|
|||||||
frappe.ready(async () => {
|
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();
|
initialise_select_date();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -9,6 +9,12 @@ WEEKDAYS = ["Monday", "Tuesday", "Wednesday",
|
|||||||
|
|
||||||
no_cache = 1
|
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)
|
@frappe.whitelist(allow_guest=True)
|
||||||
def get_appointment_settings():
|
def get_appointment_settings():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user