From 27d16ef46ee2463dca821f8736db731bd28b95b3 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 11 Nov 2013 16:33:37 +0100 Subject: [PATCH] fix period --- .../management/commands/teleforma-delete-conferences.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/teleforma/management/commands/teleforma-delete-conferences.py b/teleforma/management/commands/teleforma-delete-conferences.py index 180afa16..d5f84a43 100644 --- a/teleforma/management/commands/teleforma-delete-conferences.py +++ b/teleforma/management/commands/teleforma-delete-conferences.py @@ -23,11 +23,11 @@ class Command(BaseCommand): if not periods: sys.exit("No such period") else: - periods = periods[0] + period = periods[0] start_time = datetime.datetime(start_year, start_month, 1, 0, 0) end_time = datetime.datetime(end_year, end_month, 30, 23, 59) - conferences = Conference.objects.filter(date_begin__gte=start_time) - conferences = conferences.filter(date_begin__lte=end_time) + conferences = Conference.objects.filter(date_begin__gte=start_time, period=period) + conferences = conferences.filter(date_begin__lte=end_time, period=period) for conference in conferences: medias = Media.objects.filter(conference=conference) for media in medias: -- 2.39.5