mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 00:05:21 +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
|
|
@ -405,6 +405,7 @@ class Consumer(LoggingMixin):
|
|||
|
||||
# Don't save with the lock active. Saving will cause the file
|
||||
# renaming logic to acquire the lock as well.
|
||||
# This triggers things like file renaming
|
||||
document.save()
|
||||
|
||||
# Delete the file only if it was successfully consumed
|
||||
|
|
@ -438,6 +439,9 @@ class Consumer(LoggingMixin):
|
|||
|
||||
self._send_progress(100, 100, "SUCCESS", MESSAGE_FINISHED, document.id)
|
||||
|
||||
# Return the most up to date fields
|
||||
document.refresh_from_db()
|
||||
|
||||
return document
|
||||
|
||||
def _store(self, text, date, mime_type) -> Document:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue