Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #498 from edx/dsjen/hide-lens
Browse files Browse the repository at this point in the history
Disabling the learner lens still enables navigating to it.
  • Loading branch information
dsjen authored Jul 1, 2016
2 parents e8ff754 + a2f476a commit 019e209
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions analytics_dashboard/courses/tests/test_views/test_learners.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ def test_success(self):
})
self.assertNotContains(response, self.TABLE_ERROR_TEXT)

def test_success_if_hidden(self):
self.toggle_switch('enable_learner_analytics', False)
self.test_success()

@data(Timeout, ConnectionError, ValueError)
def test_data_api_error(self, RequestExceptionClass):
learners_payload = {'should_not': 'return this value'}
Expand Down
6 changes: 4 additions & 2 deletions analytics_dashboard/courses/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,10 @@ def get_context_data(self, **kwargs):
# Get the active primary item and remove it from the list
primary_nav_item = None
if self.active_primary_nav_item:
primary_nav_item = [i for i in primary_nav_items if i['name'] == self.active_primary_nav_item][0]
primary_nav_items.remove(primary_nav_item)
navs = [i for i in primary_nav_items if i['name'] == self.active_primary_nav_item]
if navs:
primary_nav_item = navs[0]
primary_nav_items.remove(primary_nav_item)

context.update({
'primary_nav_item': primary_nav_item,
Expand Down

0 comments on commit 019e209

Please sign in to comment.