mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-08 15:55:31 +01:00
Refresh the instance from the database before doing any file handling with it
This commit is contained in:
parent
3c325582d9
commit
7e3e0a0fa6
3 changed files with 32 additions and 1 deletions
|
|
@ -400,6 +400,13 @@ def update_filename_and_move_files(sender, instance, **kwargs):
|
|||
|
||||
with FileLock(settings.MEDIA_LOCK):
|
||||
try:
|
||||
|
||||
# If this was waiting for the lock, the filename or archive_filename
|
||||
# of this document may have been updated. This happens if multiple updates
|
||||
# get queued from the UI for the same document
|
||||
# So freshen up the data before doing anything
|
||||
instance.refresh_from_db()
|
||||
|
||||
old_filename = instance.filename
|
||||
old_source_path = instance.source_path
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue