user must be authenticated to view notes tab

This commit is contained in:
Arthur Barrett
2013-05-06 15:52:32 -04:00
parent c5728fb036
commit ceefdf0161
2 changed files with 5 additions and 6 deletions

View File

@@ -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))

View File

@@ -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
}