diff --git a/lms/djangoapps/dashboard/sysadmin.py b/lms/djangoapps/dashboard/sysadmin.py index 566cfd8432..a8dd51f54c 100644 --- a/lms/djangoapps/dashboard/sysadmin.py +++ b/lms/djangoapps/dashboard/sysadmin.py @@ -370,7 +370,7 @@ class Courses(SysadminDashboardView): msg = u'' - logging.debug('Adding course using git repo {0}'.format(gitloc)) + log.debug('Adding course using git repo {0}'.format(gitloc)) # Grab logging output for debugging imports output = StringIO.StringIO() @@ -674,7 +674,7 @@ class GitLogs(TemplateView): else: mdb = mongoengine.connect(mongo_db['db'], host=mongo_db['host']) except mongoengine.connection.ConnectionError: - logging.exception('Unable to connect to mongodb to save log, ' + log.exception('Unable to connect to mongodb to save log, ' 'please check MONGODB_LOG settings.') if course_id is None: @@ -686,8 +686,8 @@ class GitLogs(TemplateView): try: course = get_course_by_id(course_id) except Exception: # pylint: disable=broad-except - cilset = None - error_msg = _('Cannot find course {0}').format(course_id) + log.info('Cannot find course {0}'.format(course_id)) + raise Http404 # Allow only course team, instructors, and staff if not (request.user.is_staff or diff --git a/lms/djangoapps/dashboard/tests/test_sysadmin.py b/lms/djangoapps/dashboard/tests/test_sysadmin.py index 65c6d7d1e6..c6e93edd02 100644 --- a/lms/djangoapps/dashboard/tests/test_sysadmin.py +++ b/lms/djangoapps/dashboard/tests/test_sysadmin.py @@ -467,7 +467,7 @@ class TestSysAdminMongoCourseImport(SysadminBaseTestCase): response = self.client.get( reverse('gitlogs_detail', kwargs={ 'course_id': 'Not/Real/Testing'})) - self.assertIn(_('Cannot find course'), response.content) + self.assertEqual(404, response.status_code) def test_gitlog_courseteam_access(self): """