From 7abeccf4a01c3340610e9c92b7ecfdb4e00a2171 Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Wed, 6 Jan 2016 21:17:43 +0100 Subject: fixed command diff --git a/program/management/commands/update_hosts.py b/program/management/commands/update_hosts.py index e19d8ed..64619cd 100644 --- a/program/management/commands/update_hosts.py +++ b/program/management/commands/update_hosts.py @@ -8,14 +8,14 @@ class Command(NoArgsCommand): def handle_noargs(self, **options): for host in Host.objects.all(): + is_active = None for show in host.shows.all(): - is_active = None if show.is_active: is_active = True else: is_active = False - host.is_active = is_active + host.is_active = is_active - if not is_active: - host.save() + if not is_active: + host.save() -- cgit v0.10.2