Commit 716d8244 by chrisndodge

Merge pull request #6088 from edx/cdodge/no-redirect-to-dashboard

In microsites, don't redirect logged in users with enrollments to dashbo...
parents aac3cc25 6dea98f8
......@@ -45,10 +45,9 @@ def index(request):
# In this case, we want to have the user stay on a course catalog
# page to make it easier to browse for courses (and register)
if microsite.get_value(
'ALWAYS_REDIRECT_HOMEPAGE_TO_DASHBOARD_FOR_AUTHENTICATED_USER',
settings.FEATURES.get('ALWAYS_REDIRECT_HOMEPAGE_TO_DASHBOARD_FOR_AUTHENTICATED_USER', True)
) or get_course_enrollments(request.user):
'ALWAYS_REDIRECT_HOMEPAGE_TO_DASHBOARD_FOR_AUTHENTICATED_USER',
settings.FEATURES.get('ALWAYS_REDIRECT_HOMEPAGE_TO_DASHBOARD_FOR_AUTHENTICATED_USER', True)
):
return redirect(reverse('dashboard'))
if settings.FEATURES.get('AUTH_USE_CERTIFICATES'):
......
......@@ -142,9 +142,9 @@ class TestMicrosites(ModuleStoreTestCase, LoginEnrollmentTestCase):
resp = self.client.get(reverse('root'), HTTP_HOST=settings.MICROSITE_TEST_HOSTNAME)
self.assertEquals(resp.status_code, 200)
def test_redirect_on_homepage_when_has_enrollments(self):
def test_no_redirect_on_homepage_when_has_enrollments(self):
"""
Verify that a user going to homepage will redirect to dashboard if he/she has
Verify that a user going to homepage will not redirect to dashboard if he/she has
a course enrollment
"""
self.setup_users()
......@@ -154,7 +154,7 @@ class TestMicrosites(ModuleStoreTestCase, LoginEnrollmentTestCase):
self.enroll(self.course, True)
resp = self.client.get(reverse('root'), HTTP_HOST=settings.MICROSITE_TEST_HOSTNAME)
self.assertEquals(resp.status_code, 302)
self.assertEquals(resp.status_code, 200)
def test_microsite_course_enrollment(self):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment