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
OpenEdx
edx-platform
Commits
ae22b4e7
Commit
ae22b4e7
authored
Sep 19, 2017
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ResourceNotFoundError->ResourceNotFound
parent
a4c6c64f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
common/lib/xmodule/xmodule/html_module.py
+2
-2
lms/djangoapps/courseware/courses.py
+4
-4
No files found.
common/lib/xmodule/xmodule/html_module.py
View file @
ae22b4e7
...
...
@@ -6,7 +6,7 @@ import sys
import
textwrap
from
datetime
import
datetime
from
fs.errors
import
ResourceNotFound
Error
from
fs.errors
import
ResourceNotFound
from
lxml
import
etree
from
path
import
Path
as
path
from
pkg_resources
import
resource_string
...
...
@@ -260,7 +260,7 @@ class HtmlDescriptor(HtmlBlock, XmlDescriptor, EditingDescriptor): # pylint: di
return
definition
,
[]
except
(
ResourceNotFoundError
)
as
err
:
except
ResourceNotFound
as
err
:
msg
=
'Unable to load file contents at path {0}: {1} '
.
format
(
filepath
,
err
)
# add more info and re-raise
...
...
lms/djangoapps/courseware/courses.py
View file @
ae22b4e7
...
...
@@ -25,7 +25,7 @@ from django.core.urlresolvers import reverse
from
django.http
import
Http404
,
QueryDict
from
enrollment.api
import
get_course_enrollment_details
from
edxmako.shortcuts
import
render_to_string
from
fs.errors
import
ResourceNotFound
Error
from
fs.errors
import
ResourceNotFound
from
lms.djangoapps.courseware.courseware_access_exception
import
CoursewareAccessException
from
lms.djangoapps.courseware.exceptions
import
CourseAccessRedirect
from
opaque_keys.edx.keys
import
UsageKey
...
...
@@ -207,13 +207,13 @@ def find_file(filesystem, dirs, filename):
dirs: a list of path objects
filename: a string
Returns d / filename if found in dir d, else raises ResourceNotFound
Error
.
Returns d / filename if found in dir d, else raises ResourceNotFound.
"""
for
directory
in
dirs
:
filepath
=
path
(
directory
)
/
filename
if
filesystem
.
exists
(
filepath
):
return
filepath
raise
ResourceNotFound
Error
(
u"Could not find {0}"
.
format
(
filename
))
raise
ResourceNotFound
(
u"Could not find {0}"
.
format
(
filename
))
def
get_course_about_section
(
request
,
course
,
section_key
):
...
...
@@ -419,7 +419,7 @@ def get_course_syllabus_section(course, section_key):
course_id
=
course
.
id
,
static_asset_path
=
course
.
static_asset_path
,
)
except
ResourceNotFound
Error
:
except
ResourceNotFound
:
log
.
exception
(
u"Missing syllabus section
%
s in course
%
s"
,
section_key
,
course
.
location
.
to_deprecated_string
()
...
...
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