Merge pull request #2676 from edx/jbau/timezone-hotfix
Use new setting for LMS deadline display instead TIME_ZONE
This commit is contained in:
@@ -255,8 +255,8 @@ class ViewsTestCase(TestCase):
|
||||
response = self.client.get(url)
|
||||
self.assertFalse('<script>' in response.content)
|
||||
|
||||
# setting TIME_ZONE explicitly
|
||||
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE, TIME_ZONE="America/New_York")
|
||||
# setting TIME_ZONE_DISPLAYED_FOR_DEADLINES explicitly
|
||||
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE, TIME_ZONE_DISPLAYED_FOR_DEADLINES="UTC")
|
||||
class BaseDueDateTests(ModuleStoreTestCase):
|
||||
"""
|
||||
Base class that verifies that due dates are rendered correctly on a page
|
||||
@@ -289,8 +289,8 @@ class BaseDueDateTests(ModuleStoreTestCase):
|
||||
self.request = self.request_factory.get("foo")
|
||||
self.request.user = self.user
|
||||
|
||||
self.time_with_tz = "due Sep 18, 2013 at 07:30 EDT"
|
||||
self.time_without_tz = "due Sep 18, 2013 at 07:30"
|
||||
self.time_with_tz = "due Sep 18, 2013 at 11:30 UTC"
|
||||
self.time_without_tz = "due Sep 18, 2013 at 11:30"
|
||||
|
||||
def test_backwards_compatability(self):
|
||||
# The test course being used has show_timezone = False in the policy file
|
||||
|
||||
@@ -371,3 +371,7 @@ PASSWORD_DICTIONARY = ENV_TOKENS.get("PASSWORD_DICTIONARY", [])
|
||||
|
||||
### INACTIVITY SETTINGS ####
|
||||
SESSION_INACTIVITY_TIMEOUT_IN_SECONDS = AUTH_TOKENS.get("SESSION_INACTIVITY_TIMEOUT_IN_SECONDS")
|
||||
|
||||
##### LMS DEADLINE DISPLAY TIME_ZONE #######
|
||||
TIME_ZONE_DISPLAYED_FOR_DEADLINES = ENV_TOKENS.get("TIME_ZONE_DISPLAYED_FOR_DEADLINES",
|
||||
TIME_ZONE_DISPLAYED_FOR_DEADLINES)
|
||||
|
||||
@@ -1283,3 +1283,7 @@ LINKEDIN_API = {
|
||||
##### ACCOUNT LOCKOUT DEFAULT PARAMETERS #####
|
||||
MAX_FAILED_LOGIN_ATTEMPTS_ALLOWED = 5
|
||||
MAX_FAILED_LOGIN_ATTEMPTS_LOCKOUT_PERIOD_SECS = 15 * 60
|
||||
|
||||
|
||||
##### LMS DEADLINE DISPLAY TIME_ZONE #######
|
||||
TIME_ZONE_DISPLAYED_FOR_DEADLINES = 'UTC'
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
if section.get('due') is None:
|
||||
due_date = ''
|
||||
else:
|
||||
formatted_string = get_time_display(section['due'], due_date_display_format, coerce_tz=settings.TIME_ZONE)
|
||||
due_date = '' if len(formatted_string)==0 else _('due {date}'.format(date=formatted_string))
|
||||
formatted_string = get_time_display(section['due'], due_date_display_format, coerce_tz=settings.TIME_ZONE_DISPLAYED_FOR_DEADLINES)
|
||||
due_date = '' if len(formatted_string)==0 else _('due {date}').format(date=formatted_string)
|
||||
%>
|
||||
<p class="subtitle">${section['format']} ${due_date}</p>
|
||||
</a>
|
||||
|
||||
@@ -77,7 +77,7 @@ ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph",
|
||||
|
||||
%if section.get('due') is not None:
|
||||
<%
|
||||
formatted_string = get_time_display(section['due'], course.due_date_display_format, coerce_tz=settings.TIME_ZONE)
|
||||
formatted_string = get_time_display(section['due'], course.due_date_display_format, coerce_tz=settings.TIME_ZONE_DISPLAYED_FOR_DEADLINES)
|
||||
due_date = '' if len(formatted_string)==0 else _(u'due {date}').format(date=formatted_string)
|
||||
%>
|
||||
<em>
|
||||
|
||||
Reference in New Issue
Block a user