diff --git a/lms/djangoapps/course_home_api/dates/v1/views.py b/lms/djangoapps/course_home_api/dates/v1/views.py index ae47567cb4..efd184466a 100644 --- a/lms/djangoapps/course_home_api/dates/v1/views.py +++ b/lms/djangoapps/course_home_api/dates/v1/views.py @@ -84,7 +84,7 @@ class DatesTabView(RetrieveAPIView): user_timezone = user_timezone_locale['user_timezone'] data = { - 'is_archived': course.end and course.end < datetime.now(), + 'has_ended': course.has_ended(), 'course_date_blocks': [block for block in blocks if not isinstance(block, TodaysDate)], 'missed_deadlines': missed_deadlines, 'missed_gated_content': missed_gated_content, diff --git a/lms/djangoapps/courseware/views/views.py b/lms/djangoapps/courseware/views/views.py index eb88637ff6..45c7462cd3 100644 --- a/lms/djangoapps/courseware/views/views.py +++ b/lms/djangoapps/courseware/views/views.py @@ -1082,7 +1082,7 @@ def dates(request, course_id): 'reset_deadlines_url': reverse(RESET_COURSE_DEADLINES_NAME), 'reset_deadlines_redirect_url_base': COURSE_DATES_NAME, 'reset_deadlines_redirect_url_id_dict': {'course_id': str(course.id)}, - 'is_archived': course.end and course.end < datetime.now(), + 'has_ended': course.has_ended(), } return render_to_response('courseware/dates.html', context) @@ -1681,7 +1681,7 @@ def render_xblock(request, usage_key_string, check_if_enrolled=True): 'xqa_server': settings.FEATURES.get('XQA_SERVER', 'http://your_xqa_server.com'), 'missed_deadlines': missed_deadlines, 'missed_gated_content': missed_gated_content, - 'is_archived': course.end and course.end < datetime.now(), + 'has_ended': course.has_ended(), 'web_app_course_url': reverse(COURSE_HOME_VIEW_NAME, args=[course.id]), 'on_courseware_page': True, 'verified_upgrade_link': verified_upgrade_deadline_link(request.user, course=course), diff --git a/lms/templates/dates_banner.html b/lms/templates/dates_banner.html index b090cbf1d9..3b140cf53c 100644 --- a/lms/templates/dates_banner.html +++ b/lms/templates/dates_banner.html @@ -86,7 +86,7 @@ additional_styling_class = 'on-mobile' if is_mobile_app else 'has-button' -% if not is_archived: +% if not has_ended: % if on_dates_tab and not missed_deadlines: %if getattr(course, 'self_paced', False):
diff --git a/openedx/core/djangoapps/programs/tests/test_utils.py b/openedx/core/djangoapps/programs/tests/test_utils.py index d8abf1173a..61acf1dbd9 100644 --- a/openedx/core/djangoapps/programs/tests/test_utils.py +++ b/openedx/core/djangoapps/programs/tests/test_utils.py @@ -794,7 +794,7 @@ class TestProgramDataExtender(ModuleStoreTestCase): 'certificate_url': None, 'course_url': reverse('course_root', args=[self.course.id]), 'enrollment_open_date': strftime_localized(DEFAULT_ENROLLMENT_START_DATE, 'SHORT_DATE'), - 'is_course_ended': self.course.end and self.course.end < datetime.datetime.now(utc), + 'is_course_ended': self.course.has_ended(), 'is_enrolled': False, 'is_enrollment_open': True, 'upgrade_url': None, diff --git a/openedx/features/course_experience/views/course_outline.py b/openedx/features/course_experience/views/course_outline.py index bb989b3a47..1b4f7b1f8c 100644 --- a/openedx/features/course_experience/views/course_outline.py +++ b/openedx/features/course_experience/views/course_outline.py @@ -101,7 +101,7 @@ class CourseOutlineFragmentView(EdxFragmentView): 'on_course_outline_page': True, 'missed_deadlines': missed_deadlines, 'missed_gated_content': missed_gated_content, - 'is_archived': course.end and course.end < datetime.now(), + 'has_ended': course.has_ended(), } html = render_to_string('course_experience/course-outline-fragment.html', context)