Commit 8341f1b7 by Calen Pennington

Move type-checking of position earlier in courseware.views.index

parent 85fce7e3
...@@ -345,6 +345,13 @@ def _index_bulk_op(request, course_key, chapter, section, position): ...@@ -345,6 +345,13 @@ def _index_bulk_op(request, course_key, chapter, section, position):
""" """
Render the index page for the specified course. Render the index page for the specified course.
""" """
# Verify that position a string is in fact an int
if position is not None:
try:
int(position)
except ValueError:
raise Http404("Position {} is not an integer!".format(position))
user = request.user user = request.user
course = get_course_with_access(user, 'load', course_key, depth=2) course = get_course_with_access(user, 'load', course_key, depth=2)
...@@ -493,13 +500,6 @@ def _index_bulk_op(request, course_key, chapter, section, position): ...@@ -493,13 +500,6 @@ def _index_bulk_op(request, course_key, chapter, section, position):
section_descriptor, depth=None section_descriptor, depth=None
) )
# Verify that position a string is in fact an int
if position is not None:
try:
int(position)
except ValueError:
raise Http404("Position {} is not an integer!".format(position))
section_module = get_module_for_descriptor( section_module = get_module_for_descriptor(
request.user, request.user,
request, request,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment