From e8592d88be072e08400caf451e5d8c2d9021af07 Mon Sep 17 00:00:00 2001 From: Lova ANDRIARIMALALA <43842786+Xpirix@users.noreply.github.com> Date: Tue, 26 Dec 2023 08:40:14 +0300 Subject: [PATCH] Copy old packages to year folders --- qgis-app/plugins/management/commands/organize_old_package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qgis-app/plugins/management/commands/organize_old_package.py b/qgis-app/plugins/management/commands/organize_old_package.py index bcda2c58..991ed958 100644 --- a/qgis-app/plugins/management/commands/organize_old_package.py +++ b/qgis-app/plugins/management/commands/organize_old_package.py @@ -22,12 +22,12 @@ def handle(self, *args, **options): # Create the year folder if it doesn't exist os.makedirs(year_folder, exist_ok=True) - # Move the package file to the year folder + # Copy the package file to the year folder old_path = version.package.path if os.path.exists(old_path): new_path = os.path.join(year_folder, os.path.basename(old_path)) if not os.path.exists(new_path): - shutil.move(old_path, year_folder) + shutil.copy(old_path, year_folder) # Update the model with the new package path version.package.name = os.path.relpath(new_path, settings.MEDIA_ROOT)