mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
only move files if necessary
This commit is contained in:
parent
0c676b90f2
commit
d90080f325
@ -163,8 +163,9 @@ def move_new_to_old_locations(apps, schema_editor):
|
||||
for doc in Document.objects.filter(archive_checksum__isnull=False):
|
||||
new_archive_path = archive_path_new(doc)
|
||||
old_archive_path = archive_path_old(doc)
|
||||
shutil.move(new_archive_path, old_archive_path)
|
||||
logger.debug(f"Moving {new_archive_path} to {old_archive_path}")
|
||||
if new_archive_path != old_archive_path:
|
||||
logger.debug(f"Moving {new_archive_path} to {old_archive_path}")
|
||||
shutil.move(new_archive_path, old_archive_path)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
Loading…
x
Reference in New Issue
Block a user