Change all UTC timezones to import from pytz instead of Django.

This commit is contained in:
John Eskew
2017-09-19 18:17:03 -04:00
parent 02f26f55ce
commit 7dfb6cc681
26 changed files with 94 additions and 102 deletions

View File

@@ -9,7 +9,8 @@ from django.conf import settings
from django.contrib import auth
from django.template.loader import render_to_string
from django.utils.http import urlquote_plus
from django.utils.timezone import UTC
from pytz import UTC
from django.utils.translation import get_language, to_locale
from django.utils.translation import ugettext as _
from django.utils.translation import get_language, to_locale
from opaque_keys.edx.keys import CourseKey
@@ -54,7 +55,7 @@ class CourseHomeMessageFragmentView(EdxFragmentView):
course = get_course_with_access(request.user, 'load', course_key)
# Get time until the start date, if already started, or no start date, value will be zero or negative
now = datetime.now(UTC())
now = datetime.now(UTC)
already_started = course.start and now > course.start
days_until_start_string = "started" if already_started else format_timedelta(course.start - now, locale=to_locale(get_language()))
course_start_data = {