Skip to content

Commit

Permalink
Copy old packages to year folders
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Dec 26, 2023
1 parent a64eb5d commit e8592d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qgis-app/plugins/management/commands/organize_old_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e8592d8

Please sign in to comment.