mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-15 19:17:03 +01:00
Fix: correct PAPERLESS_EMPTY_TRASH_DIR to Path (#10227)
This commit is contained in:
parent
240c9ac511
commit
f214440d2e
3 changed files with 7 additions and 7 deletions
|
|
@ -331,9 +331,8 @@ def cleanup_document_deletion(sender, instance, **kwargs):
|
|||
(old_filebase, old_fileext) = os.path.splitext(old_filename)
|
||||
|
||||
while True:
|
||||
new_file_path = os.path.join(
|
||||
settings.EMPTY_TRASH_DIR,
|
||||
old_filebase + (f"_{counter:02}" if counter else "") + old_fileext,
|
||||
new_file_path = settings.EMPTY_TRASH_DIR / (
|
||||
old_filebase + (f"_{counter:02}" if counter else "") + old_fileext
|
||||
)
|
||||
|
||||
if os.path.exists(new_file_path):
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ class TestFileHandling(DirectoriesMixin, FileSystemAssertsMixin, TestCase):
|
|||
|
||||
@override_settings(
|
||||
FILENAME_FORMAT="{correspondent}/{correspondent}",
|
||||
EMPTY_TRASH_DIR=tempfile.mkdtemp(),
|
||||
EMPTY_TRASH_DIR=Path(tempfile.mkdtemp()),
|
||||
)
|
||||
def test_document_delete_trash_dir(self):
|
||||
document = Document()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue