summaryrefslogtreecommitdiff
path: root/releng/management/commands/syncisos.py
diff options
context:
space:
mode:
Diffstat (limited to 'releng/management/commands/syncisos.py')
-rw-r--r--releng/management/commands/syncisos.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/releng/management/commands/syncisos.py b/releng/management/commands/syncisos.py
index 62f005ff..f182cc33 100644
--- a/releng/management/commands/syncisos.py
+++ b/releng/management/commands/syncisos.py
@@ -4,8 +4,8 @@ from HTMLParser import HTMLParser, HTMLParseError
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
+from django.utils.timezone import now
-from main.utils import utc_now
from releng.models import Iso
@@ -20,7 +20,7 @@ class IsoListParser(HTMLParser):
if tag == 'a':
for name, value in attrs:
if name == "href":
- if value != '../' and self.url_re.search(value) != None:
+ if value != '../' and self.url_re.search(value) is not None:
self.hyperlinks.append(value[:-1])
def parse(self, url):
@@ -53,10 +53,9 @@ class Command(BaseCommand):
if not existing.active:
existing.active = True
existing.removed = None
- existing.save()
- now = utc_now()
+ existing.save(update_fields=('active', 'removed'))
# and then mark all other names as no longer active
Iso.objects.filter(active=True).exclude(name__in=active_isos).update(
- active=False, removed=now)
+ active=False, removed=now())
# vim: set ts=4 sw=4 et: