mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
Refresh the instance from the database before doing any file handling with it
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user