From: Guillaume Pellerin Date: Mon, 11 Nov 2013 15:33:37 +0000 (+0100) Subject: fix period X-Git-Tag: 2.8.1-ae~107 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=27d16ef46ee2463dca821f8736db731bd28b95b3;p=teleforma.git fix period --- 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: