Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
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
c6344aa5
Commit
c6344aa5
authored
4 years ago
by
Dave St.Germain
Browse files
Options
Downloads
Patches
Plain Diff
Only the data download tab should appear for data researchers
TNL-7222
parent
d559a358
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/instructor/tests/views/test_instructor_dashboard.py
+22
-0
22 additions, 0 deletions
...oapps/instructor/tests/views/test_instructor_dashboard.py
lms/djangoapps/instructor/views/instructor_dashboard.py
+2
-2
2 additions, 2 deletions
lms/djangoapps/instructor/views/instructor_dashboard.py
with
24 additions
and
2 deletions
lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py
+
22
−
0
View file @
c6344aa5
...
...
@@ -4,6 +4,7 @@ Unit tests for instructor_dashboard.py.
import
datetime
import
re
import
ddt
import
six
...
...
@@ -162,6 +163,27 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase, XssT
else
:
self
.
assertNotContains
(
response
,
download_section
)
@override_settings
(
ANALYTICS_DASHBOARD_URL
=
'
http://example.com
'
)
@override_settings
(
ANALYTICS_DASHBOARD_NAME
=
'
Example
'
)
def
test_data_download_only
(
self
):
"""
Verify that only the data download tab is visible for data researchers.
"""
user
=
UserFactory
.
create
()
CourseAccessRoleFactory
(
course_id
=
self
.
course
.
id
,
user
=
user
,
role
=
'
data_researcher
'
,
org
=
self
.
course
.
id
.
org
)
self
.
client
.
login
(
username
=
user
.
username
,
password
=
"
test
"
)
response
=
self
.
client
.
get
(
self
.
url
)
matches
=
re
.
findall
(
rb
'
<li class=
"
nav-item
"
><button type=
"
button
"
class=
"
btn-link .*
"
data-section=
"
.*
"
>.*
'
,
response
.
content
)
assert
len
(
matches
)
==
1
@ddt.data
(
(
"
How to defeat the Road Runner
"
,
"
2017
"
,
"
001
"
,
"
ACME
"
),
)
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/instructor/views/instructor_dashboard.py
+
2
−
2
View file @
c6344aa5
...
...
@@ -144,7 +144,7 @@ def instructor_dashboard_2(request, course_id):
sections
.
append
(
_section_data_download
(
course
,
access
))
analytics_dashboard_message
=
None
if
show_analytics_dashboard_message
(
course_key
):
if
show_analytics_dashboard_message
(
course_key
)
and
(
access
[
'
staff
'
]
or
access
[
'
instructor
'
])
:
# Construct a URL to the external analytics dashboard
analytics_dashboard_url
=
'
{0}/courses/{1}
'
.
format
(
settings
.
ANALYTICS_DASHBOARD_URL
,
six
.
text_type
(
course_key
))
link_start
=
HTML
(
u
"
<a href=
\"
{}
\"
rel=
\"
noopener
\"
target=
\"
_blank
\"
>
"
).
format
(
analytics_dashboard_url
)
...
...
@@ -174,7 +174,7 @@ def instructor_dashboard_2(request, course_id):
sections
.
insert
(
3
,
_section_extensions
(
course
))
# Gate access to course email by feature flag & by course-specific authorization
if
is_bulk_email_feature_enabled
(
course_key
):
if
is_bulk_email_feature_enabled
(
course_key
)
and
(
access
[
'
staff
'
]
or
access
[
'
instructor
'
])
:
sections
.
append
(
_section_send_email
(
course
,
access
))
# Gate access to Ecommerce tab
...
...
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