fix!: Last overriden method should be considered

This commit is contained in:
Ankush Menat 2023-09-05 16:38:09 +05:30
parent bfb463e814
commit d117e2c08b
2 changed files with 3 additions and 3 deletions

View file

@ -30,8 +30,8 @@ def handle_rpc_call(method: str, doctype: str | None = None):
# Login works implicitly right now.
return
for hook in frappe.get_hooks("override_whitelisted_methods", {}).get(method, []):
# override using the first hook
for hook in reversed(frappe.get_hooks("override_whitelisted_methods", {}).get(method, [])):
# override using the last hook
method = hook
break

View file

@ -61,7 +61,7 @@ def handle():
def execute_cmd(cmd, from_async=False):
"""execute a request as python module"""
for hook in reversed(frappe.get_hooks("override_whitelisted_methods", {}).get(cmd, [])):
# override using the first hook
# override using the last hook
cmd = hook
break