From 56345f435447fb5b385cf8a6f9eff17458d0f0c7 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Sat, 7 Mar 2026 14:39:14 +0530 Subject: [PATCH] refactor(`book_appointment`): type annotations for whitelisted methods --- erpnext/www/book_appointment/index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/www/book_appointment/index.py b/erpnext/www/book_appointment/index.py index 23425454c29..376e7afc14b 100644 --- a/erpnext/www/book_appointment/index.py +++ b/erpnext/www/book_appointment/index.py @@ -42,7 +42,7 @@ def get_timezones(): @frappe.whitelist(allow_guest=True) -def get_appointment_slots(date, timezone): +def get_appointment_slots(date: str, timezone: str): # Convert query to local timezones format_string = "%Y-%m-%d %H:%M:%S" query_start_time = datetime.datetime.strptime(date + " 00:00:00", format_string) @@ -92,7 +92,7 @@ def get_available_slots_between(query_start_time, query_end_time, settings): @frappe.whitelist(allow_guest=True) -def create_appointment(date, time, tz, contact): +def create_appointment(date: str, time: str, tz: str, contact: str): format_string = "%Y-%m-%d %H:%M:%S" scheduled_time = datetime.datetime.strptime(date + " " + time, format_string) # Strip tzinfo from datetime objects since it's handled by the doctype