From 3fa080dec496c07fa7d2a8f86d75e66c7c9be6f2 Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Wed, 6 Jan 2016 20:48:56 +0100 Subject: fixed commands diff --git a/program/management/commands/update_hosts.py b/program/management/commands/update_hosts.py index 22e0596..e19d8ed 100644 --- a/program/management/commands/update_hosts.py +++ b/program/management/commands/update_hosts.py @@ -9,13 +9,13 @@ class Command(NoArgsCommand): def handle_noargs(self, **options): for host in Host.objects.all(): for show in host.shows.all(): - hosts_active_show = None - if show.has_active_programslots: - hosts_active_show = True + is_active = None + if show.is_active: + is_active = True else: - hosts_active_show = False + is_active = False - host.hosts_active_show = hosts_active_show + host.is_active = is_active - if not hosts_active_show: + if not is_active: host.save() diff --git a/program/management/commands/update_shows.py b/program/management/commands/update_shows.py index d582bb5..805c51e 100644 --- a/program/management/commands/update_shows.py +++ b/program/management/commands/update_shows.py @@ -10,13 +10,13 @@ class Command(NoArgsCommand): def handle_noargs(self, **options): for show in Show.objects.exclude(pk=1): - has_active_programslots = None + is_active = None for programslot in show.programslots.all(): if programslot.until > date.today(): - has_active_programslots = True + is_active = True else: - has_active_programslots = False - show.has_active_programslots = has_active_programslots + is_active = False + show.is_active = is_active - if not has_active_programslots: + if not is_active: show.save() -- cgit v0.10.2