summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2016-01-06 19:48:56 (GMT)
committerErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2016-01-06 19:48:56 (GMT)
commit3fa080dec496c07fa7d2a8f86d75e66c7c9be6f2 (patch)
tree4a2338868592480f3ff9bfa31b4939f486e616af /program
parentefffafdc2843118ad810062b568593c0b1dda662 (diff)
fixed commands
Diffstat (limited to 'program')
-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()