From 10d4922f8047d6524c881b982971b2ec5e81dd5b Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun, 23 Jun 2024 10:09:58 -0700 Subject: [PATCH] Fix: always update modified for bulk actions --- src/documents/signals/handlers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/documents/signals/handlers.py b/src/documents/signals/handlers.py index 02f08ab31..21aef4cb6 100644 --- a/src/documents/signals/handlers.py +++ b/src/documents/signals/handlers.py @@ -418,7 +418,10 @@ def update_filename_and_move_files(sender, instance: Document, **kwargs): move_archive = False if not move_original and not move_archive: - # Don't do anything if filenames did not change. + # Just update modified. Also, don't save() here to prevent infinite recursion. + Document.objects.filter(pk=instance.pk).update( + modified=timezone.now(), + ) return if move_original: