moving milestones check to access.py

This commit is contained in:
Sanford Student
2016-07-05 16:41:43 -04:00
parent 933fdae5ba
commit 5db58c0038
7 changed files with 39 additions and 40 deletions

View File

@@ -25,7 +25,6 @@ import urllib
from lang_pref import LANGUAGE_KEY
from xblock.fragment import Fragment
from opaque_keys.edx.keys import CourseKey
from openedx.core.lib.gating import api as gating_api
from openedx.core.lib.time_zone_utils import get_user_time_zone
from openedx.core.djangoapps.user_api.preferences.api import get_user_preference
from shoppingcart.models import CourseRegistrationCode
@@ -143,7 +142,6 @@ class CoursewareIndex(View):
if self.chapter and self.section:
self._redirect_if_not_requested_section()
self._verify_section_not_gated()
self._save_positions()
self._prefetch_and_bind_section()
@@ -272,15 +270,6 @@ class CoursewareIndex(View):
self.chapter_url_name = exam_chapter.url_name
self.section_url_name = exam_section.url_name
def _verify_section_not_gated(self):
"""
Verify whether the section is gated and accessible to the user.
"""
gated_content = gating_api.get_gated_content(self.course, self.effective_user)
if gated_content:
if unicode(self.section.location) in gated_content:
raise Http404
def _get_language_preference(self):
"""
Returns the preferred language for the actual user making the request.