summaryrefslogtreecommitdiff
path: root/program/management
diff options
context:
space:
mode:
Diffstat (limited to 'program/management')
-rw-r--r--program/management/commands/update_hosts.py12
-rw-r--r--program/management/commands/update_shows.py10
2 files changed, 11 insertions, 11 deletions
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()