fix: assume v1 if path is not set

Old `cmd` calls will not work otherwise.
This commit is contained in:
Ankush Menat 2023-09-18 18:48:04 +05:30
parent e2714c3e1c
commit 4dfb44d0a2

View file

@ -72,7 +72,7 @@ API_URL_MAP = Map(
def get_api_version() -> ApiVersion | None:
if not frappe.request or not frappe.request.path.startswith("/api"):
if not frappe.request:
return
if frappe.request.path.startswith(f"/api/{ApiVersion.V2.value}"):