Skip to content

Commit

Permalink
[Fixes #12732] Asset file migration for documents does not work for d…
Browse files Browse the repository at this point in the history
…ocument
  • Loading branch information
mattiagiupponi committed Nov 21, 2024
1 parent 77aeaef commit cdc8ca6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions geonode/assets/management/commands/migrate_file_to_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def handle(self, **options):
logger.info("Moving file to the asset folder")

if len(asset.location) == 1:
# In older installations, all documents are stored in a single folder.
# Instead of moving the entire folder, we can simply move the individual document.
# This approach prevents the risk of breaking the other documents
# In older installations, all documents are stored in a single folder.
# Instead of moving the entire folder, we can simply move the individual document.
# This approach prevents the risk of breaking the other documents
# that are stored in the same folder
# oldpath = {MEDIA_ROOT}/documents/document/file.extension
dest = shutil.move(asset.location[0], handler._create_asset_dir())

Check warning on line 107 in geonode/assets/management/commands/migrate_file_to_assets.py

View check run for this annotation

Codecov / codecov/patch

geonode/assets/management/commands/migrate_file_to_assets.py#L107

Added line #L107 was not covered by tests
Expand Down

0 comments on commit cdc8ca6

Please sign in to comment.