From fe8906430fb0054c470ae2a3330616b50aacea8e Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 26 Jan 2026 22:23:10 +0100 Subject: [PATCH] better filter --- .../management/commands/teleforma-get-same-scripts.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/teleforma/management/commands/teleforma-get-same-scripts.py b/teleforma/management/commands/teleforma-get-same-scripts.py index 02fdd564..ff35f894 100644 --- a/teleforma/management/commands/teleforma-get-same-scripts.py +++ b/teleforma/management/commands/teleforma-get-same-scripts.py @@ -17,9 +17,10 @@ class Command(BaseCommand): scripts = [] ss = Script.objects.filter(period=period) for script in ss: - sss = ss.filter(file=script.file) + sss = ss.filter(file=script.file).exclude(id=script.id) for s in sss: - scripts.append(s) - if not s.author in users: - users.append(s.author.username) + if not s in scripts: + scripts.append(s) + if not s.author in users: + users.append(s.author.username) print(users) -- 2.39.5