Merge pull request #21542 from edx/awais786/BOM-302

BOM-302
This commit is contained in:
Awais Qureshi
2019-09-04 11:38:28 +05:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -622,7 +622,7 @@ def get_current_child(xmodule, min_depth=None, requested_child=None):
children = xmodule.get_display_items()
if len(children) > 0:
if xmodule.position is not None and not requested_child:
pos = xmodule.position - 1 # position is 1-indexed
pos = int(xmodule.position) - 1 # position is 1-indexed
if 0 <= pos < len(children):
child = children[pos]
if min_depth is not None and (min_depth > 0 and not child.has_children_at_depth(min_depth - 1)):

View File

@@ -344,7 +344,7 @@ def get_notes(request, course, page=DEFAULT_PAGE, page_size=DEFAULT_PAGE_SIZE, t
response = send_request(request.user, course.id, page, page_size, path, text)
try:
collection = json.loads(response.content.decode('utf-8'))
collection = json.loads(response.content)
except ValueError:
log.error(u"Invalid JSON response received from notes api: response_content=%s", response.content)
raise EdxNotesParseError(_("Invalid JSON response received from notes api."))