From 4c6be29bbb86d7f853f346c7d4555a6300f7c229 Mon Sep 17 00:00:00 2001 From: frimpongopoku Date: Fri, 20 Oct 2023 10:51:09 +0000 Subject: [PATCH] only one email summary for all will be sent now after the task --- src/task_queue/database_tasks/media_library_cleanup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/task_queue/database_tasks/media_library_cleanup.py b/src/task_queue/database_tasks/media_library_cleanup.py index 17581a8ee..7b1f60102 100644 --- a/src/task_queue/database_tasks/media_library_cleanup.py +++ b/src/task_queue/database_tasks/media_library_cleanup.py @@ -26,9 +26,10 @@ def remove_duplicate_images(): flag = FeatureFlag.objects.filter(key=REMOVE_DUPLICATE_IMAGE_FLAG_KEY).first() communities = flag.enabled_communities() task = Task.objects.filter(name = "Media Library Cleanup Routine").first() - for community in communities: - ids = [community.id] - clean_and_notify(ids,community,task.creator) + # for community in communities: + # ids = [community.id] + ids = [c.id for c in communities] + clean_and_notify(ids,None,task.creator) return "success"