Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
3aecac7a
Commit
3aecac7a
authored
Jan 22, 2014
by
Carson Gee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct exception raising bug for non global staff accessing missing course git logs
parent
d35a56bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
lms/djangoapps/dashboard/sysadmin.py
+4
-4
lms/djangoapps/dashboard/tests/test_sysadmin.py
+1
-1
No files found.
lms/djangoapps/dashboard/sysadmin.py
View file @
3aecac7a
...
...
@@ -370,7 +370,7 @@ class Courses(SysadminDashboardView):
msg
=
u''
log
ging
.
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
:
log
ging
.
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
...
...
lms/djangoapps/dashboard/tests/test_sysadmin.py
View file @
3aecac7a
...
...
@@ -467,7 +467,7 @@ class TestSysAdminMongoCourseImport(SysadminBaseTestCase):
response
=
self
.
client
.
get
(
reverse
(
'gitlogs_detail'
,
kwargs
=
{
'course_id'
:
'Not/Real/Testing'
}))
self
.
assert
In
(
_
(
'Cannot find course'
),
response
.
content
)
self
.
assert
Equal
(
404
,
response
.
status_code
)
def
test_gitlog_courseteam_access
(
self
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment