Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit 2c62583

Browse files
committed
Explain file-rename logic
1 parent f2220d3 commit 2c62583

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/documents/signals/handlers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ def set_tags(sender,
226226
def cleanup_document_deletion(sender, instance, using, **kwargs):
227227
with FileLock(settings.MEDIA_LOCK):
228228
if settings.TRASH_DIR:
229+
# Find a non-conflicting filename in case a document with the same
230+
# name was moved to trash earlier
229231
counter = 0
230232
old_filename = os.path.split(instance.source_path)[1]
231233
(old_filebase, old_fileext) = os.path.splitext(old_filename)

0 commit comments

Comments
 (0)