fix: Handle exception

This commit is contained in:
Suraj Shetty 2021-05-06 14:52:32 +05:30
parent aab2aca089
commit ba88b2cdb9

View file

@ -158,7 +158,7 @@ def evaluate_dynamic_routes(rules, path):
route_map = Map(rules)
endpoint = None
if frappe.local.request and frappe.local.request.environ:
if hasattr(frappe.local, 'request') and frappe.local.request.environ:
urls = route_map.bind_to_environ(frappe.local.request.environ)
try:
endpoint, args = urls.match("/" + path)