Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
problem-builder
Commits
cd69698b
Commit
cd69698b
authored
Jul 14, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch IndexError that gets thrown when user provides invalid root block ID.
parent
90e0b0e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
4 deletions
+1
-4
problem_builder/tasks.py
+1
-4
No files found.
problem_builder/tasks.py
View file @
cd69698b
...
@@ -6,7 +6,6 @@ import time
...
@@ -6,7 +6,6 @@ import time
from
celery.task
import
task
from
celery.task
import
task
from
celery.utils.log
import
get_task_logger
from
celery.utils.log
import
get_task_logger
from
instructor_task.models
import
ReportStore
from
instructor_task.models
import
ReportStore
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
CourseKey
from
opaque_keys.edx.keys
import
CourseKey
from
student.models
import
user_by_anonymous_id
from
student.models
import
user_by_anonymous_id
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
...
@@ -31,9 +30,7 @@ def export_data(course_id, source_block_id_str, block_types, user_id, match_stri
...
@@ -31,9 +30,7 @@ def export_data(course_id, source_block_id_str, block_types, user_id, match_stri
try
:
try
:
course_key
=
CourseKey
.
from_string
(
course_id
)
course_key
=
CourseKey
.
from_string
(
course_id
)
src_block
=
modulestore
()
.
get_items
(
course_key
,
qualifiers
=
{
'name'
:
source_block_id_str
},
depth
=
0
)[
0
]
src_block
=
modulestore
()
.
get_items
(
course_key
,
qualifiers
=
{
'name'
:
source_block_id_str
},
depth
=
0
)[
0
]
if
src_block
is
None
:
except
IndexError
:
raise
InvalidKeyError
except
InvalidKeyError
:
raise
ValueError
(
"Could not find the specified Block ID."
)
raise
ValueError
(
"Could not find the specified Block ID."
)
course_key_str
=
unicode
(
course_key
)
course_key_str
=
unicode
(
course_key
)
...
...
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