fix: Return dummy function to avoid NoneType not callable

This commit is contained in:
Gavin D'souza 2020-11-30 15:23:42 +05:30
parent 4810d07a8a
commit d5d0bc8ea9

View file

@ -21,7 +21,9 @@ class NamespaceDict(frappe._dict):
def __getattr__(self, key):
ret = self.get(key)
if (not ret and key.startswith("__")) or (key not in self):
raise AttributeError(f"module has no attribute '{key}'")
def default_function(*args, **kwargs):
raise AttributeError(f"module has no attribute '{key}'")
return default_function
return ret