Commit ceefdf01 by Arthur Barrett

user must be authenticated to view notes tab

parent c5728fb0
......@@ -185,10 +185,10 @@ def _combined_open_ended_grading(tab, user, course, active_page):
return tab
return []
def _student_notes(tab, user, course, active_page):
if settings.MITX_FEATURES.get('ENABLE_STUDENT_NOTES'):
def _notes_tab(tab, user, course, active_page):
if user.is_authenticated() and settings.MITX_FEATURES.get('ENABLE_STUDENT_NOTES'):
link = reverse('notes', args=[course.id])
return [CourseTab('My Notes', link, active_page == 'notes')]
return [CourseTab(tab['name'], link, active_page == 'notes')]
return []
#### Validators
......@@ -232,7 +232,7 @@ VALID_TAB_TYPES = {
'peer_grading': TabImpl(null_validator, _peer_grading),
'staff_grading': TabImpl(null_validator, _staff_grading),
'open_ended': TabImpl(null_validator, _combined_open_ended_grading),
'notes': TabImpl(null_validator, _student_notes)
'notes': TabImpl(null_validator, _notes_tab)
}
......@@ -326,8 +326,6 @@ def get_default_tabs(user, course, active_page):
tabs.extend(_wiki({'name': 'Wiki', 'type': 'wiki'}, user, course, active_page))
tabs.extend(_student_notes({'name': 'Notes', 'type': 'notes'}, user, course, active_page))
if user.is_authenticated() and not course.hide_progress_tab:
tabs.extend(_progress({'name': 'Progress'}, user, course, active_page))
......
......@@ -92,6 +92,7 @@ MITX_FEATURES = {
# Staff Debug tool.
'ENABLE_STUDENT_HISTORY_VIEW': True,
# Enables the student notes API and UI.
'ENABLE_STUDENT_NOTES': True
}
......
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