From: Guillaume Pellerin Date: Mon, 26 Jan 2026 21:23:10 +0000 (+0100) Subject: better filter X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=fe8906430fb0054c470ae2a3330616b50aacea8e;p=teleforma.git better filter --- 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)