fix: Check if path is a module first then function
This commit is contained in:
parent
b32db6e329
commit
976ebd5b2c
1 changed files with 5 additions and 1 deletions
|
|
@ -149,7 +149,11 @@ def get_jinja_hooks():
|
|||
def get_obj_dict_from_paths(object_paths):
|
||||
out = {}
|
||||
for obj_path in object_paths:
|
||||
obj = frappe.get_attr(obj_path)
|
||||
try:
|
||||
obj = frappe.get_module(obj_path)
|
||||
except ModuleNotFoundError:
|
||||
obj = frappe.get_attr(obj_path)
|
||||
|
||||
if isinstance(obj, ModuleType):
|
||||
functions = getmembers(obj, isfunction)
|
||||
for function_name, function in functions:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue