fix: make sure limit is an integer
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
bd48f5df65
commit
0ea49a8f1e
4 changed files with 7 additions and 7 deletions
|
|
@ -167,7 +167,7 @@ def format_email_header(header_map, language, docname):
|
|||
|
||||
@frappe.whitelist()
|
||||
@http_cache(max_age=60, stale_while_revalidate=60 * 60)
|
||||
def get_notification_logs(limit=20):
|
||||
def get_notification_logs(limit: int = 20):
|
||||
notification_logs = frappe.db.get_list(
|
||||
"Notification Log", fields=["*"], limit=limit, order_by="creation desc"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -109,11 +109,11 @@ class FrappeClient:
|
|||
|
||||
def get_list(
|
||||
self,
|
||||
doctype,
|
||||
doctype: str,
|
||||
fields='["name"]',
|
||||
filters=None,
|
||||
limit_start=0,
|
||||
limit_page_length=None,
|
||||
limit_start: int = 0,
|
||||
limit_page_length: int | None = None,
|
||||
order_by=None,
|
||||
group_by=None,
|
||||
):
|
||||
|
|
|
|||
|
|
@ -182,8 +182,8 @@ class DatabaseQuery:
|
|||
"or_filters": or_filters,
|
||||
"group_by": group_by,
|
||||
"order_by": order_by,
|
||||
"limit": limit,
|
||||
"offset": offset,
|
||||
"limit": frappe.cint(limit),
|
||||
"offset": frappe.cint(offset),
|
||||
"distinct": distinct,
|
||||
"ignore_permissions": ignore_permissions,
|
||||
"user": user,
|
||||
|
|
|
|||
|
|
@ -849,7 +849,7 @@ def get_site_info():
|
|||
kwargs = {
|
||||
"fields": ["user", "creation", "full_name"],
|
||||
"filters": {"operation": "Login", "status": "Success"},
|
||||
"limit": "10",
|
||||
"limit": 10,
|
||||
}
|
||||
|
||||
site_info = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue