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
40545441
Commit
40545441
authored
Aug 07, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle exceptions inside the outer exception handling
parent
69c34a65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
cms/djangoapps/contentstore/views/assets.py
+14
-7
No files found.
cms/djangoapps/contentstore/views/assets.py
View file @
40545441
...
...
@@ -346,13 +346,20 @@ def generate_export_course(request, org, course, name):
try
:
export_to_xml
(
modulestore
(
'direct'
),
contentstore
(),
loc
,
root_dir
,
name
,
modulestore
())
except
SerializationError
,
e
:
failed_item
=
modulestore
()
.
get_instance
(
course_module
.
location
.
course_id
,
e
.
location
)
parent_locs
=
modulestore
()
.
get_parent_locations
(
failed_item
.
location
,
course_module
.
location
.
course_id
)
unit
=
None
if
len
(
parent_locs
)
>
0
:
parent
=
modulestore
()
.
get_item
(
parent_locs
[
0
])
if
parent
.
location
.
category
==
'vertical'
:
unit
=
parent
failed_item
=
None
parent
=
None
try
:
failed_item
=
modulestore
()
.
get_instance
(
course_module
.
location
.
course_id
,
e
.
location
)
parent_locs
=
modulestore
()
.
get_parent_locations
(
failed_item
.
location
,
course_module
.
location
.
course_id
)
if
len
(
parent_locs
)
>
0
:
parent
=
modulestore
()
.
get_item
(
parent_locs
[
0
])
if
parent
.
location
.
category
==
'vertical'
:
unit
=
parent
except
:
# if we have a nested exception, then we'll show the more generic error message
pass
return
render_to_response
(
'export.html'
,
{
'context_course'
:
course_module
,
...
...
@@ -363,7 +370,7 @@ def generate_export_course(request, org, course, name):
'unit'
:
unit
,
'edit_unit_url'
:
reverse
(
'edit_unit'
,
kwargs
=
{
'location'
:
parent
.
location
}),
})
if
parent
else
''
,
'course_home_url'
:
reverse
(
'course_index'
,
kwargs
=
{
'org'
:
org
,
'course'
:
course
,
...
...
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