From 43a4325f6a5569d5c425b317ef3a776dfbb570c7 Mon Sep 17 00:00:00 2001 From: Zherebkin <51083437+Zherebkin@users.noreply.github.com> Date: Thu, 22 Oct 2020 18:54:45 +0300 Subject: [PATCH] Upgrade to Juniper (#37) --- scormxblock/scormxblock.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scormxblock/scormxblock.py b/scormxblock/scormxblock.py index 27f2390c..12f8feab 100644 --- a/scormxblock/scormxblock.py +++ b/scormxblock/scormxblock.py @@ -18,8 +18,8 @@ from xblock.core import XBlock from xblock.fields import Scope, String, Float, Boolean, Dict, DateTime, Integer -from xblock.fragment import Fragment from xblockutils.resources import ResourceLoader +from web_fragments.fragment import Fragment # Make '_' a no-op so we can scrape strings @@ -191,7 +191,7 @@ def studio_submit(self, request, suffix=''): self.set_fields_xblock(path_to_file) - return Response(json.dumps({'result': 'success'}), content_type='application/json') + return Response(json.dumps({'result': 'success'}), content_type='application/json', charset="utf8") @XBlock.json_handler def scorm_get_value(self, data, suffix=''): @@ -345,7 +345,7 @@ def get_sha1(self, file_descriptor): """ block_size = 8 * 1024 sha1 = hashlib.sha1() - for block in iter(partial(file_descriptor.read, block_size), ''): + for block in iter(partial(file_descriptor.read, block_size), b''): sha1.update(block) file_descriptor.seek(0) return sha1.hexdigest()