Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
6dea98f8
Commit
6dea98f8
authored
10 years ago
by
Chris Dodge
Browse files
Options
Downloads
Patches
Plain Diff
In microsites, don't redirect logged in users with enrollments to dashboard
parent
aa9440b1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/branding/views.py
+3
-4
3 additions, 4 deletions
lms/djangoapps/branding/views.py
lms/djangoapps/courseware/tests/test_microsites.py
+3
-3
3 additions, 3 deletions
lms/djangoapps/courseware/tests/test_microsites.py
with
6 additions
and
7 deletions
lms/djangoapps/branding/views.py
+
3
−
4
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
'
):
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/courseware/tests/test_microsites.py
+
3
−
3
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
):
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment