Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
6dea98f8
Commit
6dea98f8
authored
Nov 29, 2014
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In microsites, don't redirect logged in users with enrollments to dashboard
parent
aa9440b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
lms/djangoapps/branding/views.py
+3
-4
lms/djangoapps/courseware/tests/test_microsites.py
+3
-3
No files found.
lms/djangoapps/branding/views.py
View file @
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'
):
...
...
lms/djangoapps/courseware/tests/test_microsites.py
View file @
6dea98f8
...
...
@@ -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
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment