From 8341f1b7c8267b15cfad27d6142d577aa0c5341d Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Fri, 27 Mar 2015 14:23:13 -0400 Subject: [PATCH] Move type-checking of position earlier in courseware.views.index --- lms/djangoapps/courseware/views.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index 7b19c24c51..a7b3ea6530 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -345,6 +345,13 @@ def _index_bulk_op(request, course_key, chapter, section, position): """ 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 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): 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( request.user, request,