mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
fix: remove unnecessary permissions from Appointment and Appointment Booking Settings (#33358) (#33395)
This commit is contained in:
@@ -2,8 +2,6 @@ frappe.ready(async () => {
|
||||
initialise_select_date();
|
||||
})
|
||||
|
||||
window.holiday_list = [];
|
||||
|
||||
async function initialise_select_date() {
|
||||
navigate_to_page(1);
|
||||
await get_global_variables();
|
||||
@@ -20,7 +18,6 @@ async function get_global_variables() {
|
||||
window.timezones = (await frappe.call({
|
||||
method:'erpnext.www.book_appointment.index.get_timezones'
|
||||
})).message;
|
||||
window.holiday_list = window.appointment_settings.holiday_list;
|
||||
}
|
||||
|
||||
function setup_timezone_selector() {
|
||||
|
||||
@@ -26,8 +26,12 @@ def get_context(context):
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def get_appointment_settings():
|
||||
settings = frappe.get_doc("Appointment Booking Settings")
|
||||
settings.holiday_list = frappe.get_doc("Holiday List", settings.holiday_list)
|
||||
settings = frappe.get_cached_value(
|
||||
"Appointment Booking Settings",
|
||||
None,
|
||||
["advance_booking_days", "appointment_duration", "success_redirect_url"],
|
||||
as_dict=True,
|
||||
)
|
||||
return settings
|
||||
|
||||
|
||||
@@ -106,7 +110,7 @@ def create_appointment(date, time, tz, contact):
|
||||
appointment.customer_details = contact.get("notes", None)
|
||||
appointment.customer_email = contact.get("email", None)
|
||||
appointment.status = "Open"
|
||||
appointment.insert()
|
||||
appointment.insert(ignore_permissions=True)
|
||||
return appointment
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import frappe
|
||||
from frappe.utils.verified_command import verify_request
|
||||
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def get_context(context):
|
||||
if not verify_request():
|
||||
context.success = False
|
||||
|
||||
Reference in New Issue
Block a user