From 20c7e3b055a7a7b0a7bbd45fcfd2c3c221e89617 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Thu, 19 Oct 2023 15:31:26 -0400 Subject: [PATCH] Place JSON configs for card components etc in correct place #10160 Before, JSON files for further card components, reports, or plugins beyond the first would overwrite the previous one in place. --- arches/management/commands/packages.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arches/management/commands/packages.py b/arches/management/commands/packages.py index 0c78c995621..81b54ae3aa4 100644 --- a/arches/management/commands/packages.py +++ b/arches/management/commands/packages.py @@ -802,10 +802,12 @@ def load_extensions(package_dir, ext_type, cmd): modules.extend(glob.glob(os.path.join(extension, "*.py"))) if len(modules) > 0: + if os.path.exists(module_dir) is False: + os.mkdir(module_dir) dest_path = os.path.join(module_dir, os.path.basename(modules[0])) if os.path.exists(dest_path) is False: module = modules[0] - shutil.copy(module, module_dir) + shutil.copy(module, dest_path) management.call_command(cmd, "register", source=module) else: logger.info("Not loading {0} from package. Extension already exists".format(modules[0]))