mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-23 21:22:42 +01:00
refactor(templates): type annotations for whitelisted methods
This commit is contained in:
@@ -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)}},
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user