test cases for #67

This commit is contained in:
jonaswinkler
2020-11-29 15:47:56 +01:00
parent a27daaebe9
commit 023aeea7ea
5 changed files with 43 additions and 18 deletions

View File

@@ -169,7 +169,9 @@ class Consumer(LoggingMixin):
# Afte performing all database operations and moving files
# into place, tell paperless where the file is.
document.filename = generate_filename(document)
document.filename = os.path.basename(document.source_path)
# Saving the document now will trigger the filename handling
# logic.
document.save()
# Delete the file only if it was successfully consumed