Allow due-dates for self-paced courses in the course outline

This commit is contained in:
Calen Pennington
2020-02-21 11:58:17 -05:00
parent 46e0ecfb89
commit f3bce46757
3 changed files with 7 additions and 2 deletions

View File

@@ -91,7 +91,7 @@ self_paced = context.get('self_paced', False)
##
## Exam subsections expose exam status message field as well as a status icon
<%
if subsection.get('due') is None or self_paced:
if subsection.get('due') is None or (self_paced and not in_edx_when):
# examples: Homework, Lab, etc.
data_string = subsection.get('format')
data_datetime = ""

View File

@@ -218,7 +218,7 @@ class TestCourseHomePage(CourseHomePageTestCase):
# Fetch the view and verify the query counts
# TODO: decrease query count as part of REVO-28
with self.assertNumQueries(73, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST):
with self.assertNumQueries(74, table_blacklist=QUERY_COUNT_TABLE_BLACKLIST):
with check_mongo_calls(4):
url = course_home_url(self.course)
self.client.get(url)

View File

@@ -10,6 +10,7 @@ from completion import waffle as completion_waffle
from django.contrib.auth.models import User
from django.template.context_processors import csrf
from django.template.loader import render_to_string
import edx_when.api as edx_when_api
from opaque_keys.edx.keys import CourseKey
from pytz import UTC
from waffle.models import Switch
@@ -71,6 +72,10 @@ class CourseOutlineFragmentView(EdxFragmentView):
if page_context:
context['self_paced'] = page_context.get('pacing_type', 'instructor_paced') == 'self_paced'
# We're using this flag to prevent old self-paced dates from leaking out on courses not
# managed by edx-when.
context['in_edx_when'] = edx_when_api.is_enabled_for_course(course_key)
html = render_to_string('course_experience/course-outline-fragment.html', context)
return Fragment(html)