moving milestones check to access.py and upgrading milestones version
This commit is contained in:
@@ -32,7 +32,6 @@ from xblock.exceptions import NoSuchHandlerError, NoSuchViewError
|
||||
from xblock.reference.plugins import FSService
|
||||
|
||||
import static_replace
|
||||
from openedx.core.lib.gating import api as gating_api
|
||||
from courseware.access import has_access, get_user_role
|
||||
from courseware.entrance_exams import (
|
||||
get_entrance_exam_score,
|
||||
@@ -164,9 +163,6 @@ def toc_for_course(user, request, course, active_chapter, active_section, field_
|
||||
# before the rest of the content is made available
|
||||
required_content = milestones_helpers.get_required_content(course, user)
|
||||
|
||||
# Check for gated content
|
||||
gated_content = gating_api.get_gated_content(course, user)
|
||||
|
||||
# The user may not actually have to complete the entrance exam, if one is required
|
||||
if not user_must_complete_entrance_exam(request, user, course):
|
||||
required_content = [content for content in required_content if not content == course.entrance_exam_id]
|
||||
@@ -189,9 +185,7 @@ def toc_for_course(user, request, course, active_chapter, active_section, field_
|
||||
|
||||
sections = list()
|
||||
for section in chapter.get_display_items():
|
||||
# skip the section if it is gated/hidden from the user
|
||||
if gated_content and unicode(section.location) in gated_content:
|
||||
continue
|
||||
# skip the section if it is hidden from the user
|
||||
if section.hide_from_toc:
|
||||
continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user