Replace timezone.utc with timezone_utc.

This commit is contained in:
hackerkid
2017-04-15 06:59:56 +05:30
committed by Tim Abbott
parent c47dd65c14
commit 55c3d12078
8 changed files with 18 additions and 14 deletions

View File

@@ -10,6 +10,7 @@ from datetime import timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from django.utils.timezone import utc as timezone_utc
from django.utils.dateparse import parse_datetime
from django.conf import settings
@@ -58,7 +59,7 @@ class Command(BaseCommand):
# type: (Dict[str, Any]) -> None
fill_to_time = parse_datetime(options['time'])
if options['utc']:
fill_to_time = fill_to_time.replace(tzinfo=timezone.utc)
fill_to_time = fill_to_time.replace(tzinfo=timezone_utc)
if fill_to_time.tzinfo is None:
raise ValueError("--time must be timezone aware. Maybe you meant to use the --utc option?")