euscanwww: use tz aware datetimes
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
This commit is contained in:
parent
6e0706d638
commit
9e1ff8adb7
@ -88,7 +88,7 @@ class Command(BaseCommand):
|
||||
old_maintainers = set(existing_maintainers).difference(maintainers.keys())
|
||||
|
||||
for herd in obj.herds.all():
|
||||
if herd.email in old_herds:
|
||||
if herd.herd in old_herds:
|
||||
obj.herds.remove(herd)
|
||||
|
||||
for herd in new_herds:
|
||||
|
@ -9,6 +9,7 @@ from datetime import datetime
|
||||
from portage import versions
|
||||
from optparse import make_option
|
||||
|
||||
from django.utils import timezone
|
||||
from django.db.transaction import commit_on_success
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from djeuscan.models import Package, Version, EuscanResult, VersionLog
|
||||
@ -120,7 +121,7 @@ class Command(BaseCommand):
|
||||
obj = EuscanResult()
|
||||
obj.package = package
|
||||
obj.result = log
|
||||
obj.datetime = datetime.now()
|
||||
obj.datetime = timezone.now()
|
||||
obj.save()
|
||||
|
||||
|
||||
|
@ -5,6 +5,7 @@ from optparse import make_option
|
||||
from django.db.models import Count, Sum
|
||||
from django.db.transaction import commit_on_success
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.utils import timezone
|
||||
|
||||
from djeuscan.models import Package, Herd, Maintainer, Version
|
||||
from djeuscan.models import HerdLog, MaintainerLog, CategoryLog, WorldLog
|
||||
@ -44,7 +45,7 @@ class Command(BaseCommand):
|
||||
|
||||
@commit_on_success
|
||||
def handle(self, *args, **options):
|
||||
now = datetime.datetime.now()
|
||||
now = timezone.now()
|
||||
|
||||
categories = {}
|
||||
herds = {}
|
||||
|
Loading…
Reference in New Issue
Block a user