From ced763521376ff904bc9d9222eb9ae43389fac39 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 20 Nov 2023 18:28:39 -0500 Subject: [PATCH] Fix function registration The sample function file and the docs both suggest placing function.py files loose under /extensions/functions, e.g. extensions/functions/foo.py. The globbing pattern here was skipping over them, expecting them instead at extensions/functions/foo/foo.py. --- arches/management/commands/packages.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arches/management/commands/packages.py b/arches/management/commands/packages.py index 78b38752dd2..f37b7ba9dfa 100644 --- a/arches/management/commands/packages.py +++ b/arches/management/commands/packages.py @@ -797,7 +797,10 @@ def load_extensions(package_dir, ext_type, cmd): else: logger.info("Not loading {0} from package. Extension already exists".format(components[0])) - modules = glob.glob(os.path.join(extension, "*.json")) + modules = [] + if not os.path.isdir(extension): + modules.extend(extension) + modules.extend(glob.glob(os.path.join(extension, "*.json"))) modules.extend(glob.glob(os.path.join(extension, "*.py"))) if len(modules) > 0: