refactor(templates): type annotations for whitelisted methods

This commit is contained in:
diptanilsaha
2026-03-07 14:36:07 +05:30
parent decd9343ee
commit b51c59d20d
3 changed files with 4 additions and 4 deletions

View File

@@ -65,7 +65,7 @@ def get_tasks(project, start=0, search=None, item_status=None):
@frappe.whitelist()
def get_task_html(project, start=0, item_status=None):
def get_task_html(project: str, start: int = 0, item_status: str | None = None):
return frappe.render_template(
"erpnext/templates/includes/projects/project_tasks.html",
{
@@ -105,7 +105,7 @@ def get_timesheets(project, start=0, search=None):
@frappe.whitelist()
def get_timesheet_html(project, start=0):
def get_timesheet_html(project: str, start: int = 0):
return frappe.render_template(
"erpnext/templates/includes/projects/project_timesheets.html",
{"doc": {"timesheets": get_timesheets(project, start)}},

View File

@@ -23,7 +23,7 @@ def get_context(context):
@frappe.whitelist(allow_guest=True)
def get_help_results_sections(text):
def get_help_results_sections(text: str):
out = []
settings = frappe.get_doc("Support Settings", "Support Settings")

View File

@@ -7,7 +7,7 @@ from frappe.utils import escape_html
@frappe.whitelist(allow_guest=True)
def send_message(sender, message, subject="Website Query"):
def send_message(sender: str, message: str, subject: str = "Website Query"):
from frappe.www.contact import send_message as website_send_message
website_send_message(sender, message, subject)