mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 00:05:21 +01:00
Merge branch 'dev' into feature-ocrmypdf
This commit is contained in:
commit
39c682dc07
11 changed files with 56 additions and 29 deletions
|
|
@ -224,7 +224,11 @@ def update_filename_and_move_files(sender, instance, **kwargs):
|
|||
try:
|
||||
os.rename(old_path, new_path)
|
||||
instance.filename = new_filename
|
||||
instance.save()
|
||||
# Don't save here to prevent infinite recursion.
|
||||
Document.objects.filter(pk=instance.pk).update(filename=new_filename)
|
||||
|
||||
logging.getLogger(__name__).debug(
|
||||
f"Moved file {old_path} to {new_path}.")
|
||||
|
||||
except OSError as e:
|
||||
instance.filename = old_filename
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue