Remove course bypass_home setting and references
This commit is contained in:
@@ -958,17 +958,6 @@ class CourseFields(object):
|
||||
scope=Scope.settings
|
||||
)
|
||||
|
||||
bypass_home = Boolean(
|
||||
display_name=_("Bypass Course Home"),
|
||||
help=_(
|
||||
"Bypass the course home tab when students arrive from the dashboard, "
|
||||
"sending them directly to course content."
|
||||
),
|
||||
default=False,
|
||||
scope=Scope.settings,
|
||||
deprecated=True
|
||||
)
|
||||
|
||||
enable_subsection_gating = Boolean(
|
||||
display_name=_("Enable Subsection Prerequisites"),
|
||||
help=_(
|
||||
|
||||
@@ -375,17 +375,6 @@ class SelfPacedTestCase(unittest.TestCase):
|
||||
self.assertFalse(self.course.self_paced)
|
||||
|
||||
|
||||
class BypassHomeTestCase(unittest.TestCase):
|
||||
"""Tests for setting which allows course home to be bypassed."""
|
||||
|
||||
def setUp(self):
|
||||
super(BypassHomeTestCase, self).setUp()
|
||||
self.course = get_dummy_course('2012-12-02T12:00')
|
||||
|
||||
def test_default(self):
|
||||
self.assertFalse(self.course.bypass_home)
|
||||
|
||||
|
||||
class CourseDescriptorTestCase(unittest.TestCase):
|
||||
"""
|
||||
Tests for a select few functions from CourseDescriptor.
|
||||
|
||||
@@ -907,22 +907,12 @@ class ViewsTestCase(BaseViewsTestCase):
|
||||
def test_bypass_course_info(self):
|
||||
course_id = six.text_type(self.course_key)
|
||||
|
||||
self.assertFalse(self.course.bypass_home)
|
||||
|
||||
response = self.client.get(reverse('info', args=[course_id]))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
response = self.client.get(reverse('info', args=[course_id]), HTTP_REFERER=reverse('dashboard'))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
self.course.bypass_home = True
|
||||
self.store.update_item(self.course, self.user.id)
|
||||
self.assertTrue(self.course.bypass_home)
|
||||
|
||||
response = self.client.get(reverse('info', args=[course_id]), HTTP_REFERER=reverse('dashboard'))
|
||||
|
||||
self.assertRedirects(response, reverse('courseware', args=[course_id]), fetch_redirect_response=False)
|
||||
|
||||
response = self.client.get(reverse('info', args=[course_id]), HTTP_REFERER='foo')
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
|
||||
@@ -460,13 +460,6 @@ def course_info(request, course_id):
|
||||
if not user_can_skip_entrance_exam(user, course):
|
||||
return redirect(reverse('courseware', args=[text_type(course.id)]))
|
||||
|
||||
# TODO: LEARNER-611: Remove deprecated course.bypass_home.
|
||||
# If the user is coming from the dashboard and bypass_home setting is set,
|
||||
# redirect them straight to the courseware page.
|
||||
is_from_dashboard = reverse('dashboard') in request.META.get('HTTP_REFERER', [])
|
||||
if course.bypass_home and is_from_dashboard:
|
||||
return redirect(reverse('courseware', args=[course_id]))
|
||||
|
||||
# Construct the dates fragment
|
||||
dates_fragment = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user