mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
uses shutil.move instead of rename
fixes issues with cross-filesystem movement Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
This commit is contained in:
parent
1d3300fb34
commit
8e9d1cdd18
@ -1,5 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.admin.models import ADDITION
|
from django.contrib.admin.models import ADDITION
|
||||||
@ -252,7 +253,7 @@ def cleanup_document_deletion(sender, instance, using, **kwargs):
|
|||||||
|
|
||||||
logger.debug(f"Moving {instance.source_path} to trash at {new_file_path}")
|
logger.debug(f"Moving {instance.source_path} to trash at {new_file_path}")
|
||||||
try:
|
try:
|
||||||
os.rename(instance.source_path, new_file_path)
|
shutil.move(instance.source_path, new_file_path)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
logger.error(
|
logger.error(
|
||||||
f"Failed to move {instance.source_path} to trash at "
|
f"Failed to move {instance.source_path} to trash at "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user