diff --git a/README.rst b/README.rst index 893f9e2d17a26da6e3548ebeed91ce5cf477a264..ee17c403c5e23bd2e149795649fdcfab9fbbae27 100644 --- a/README.rst +++ b/README.rst @@ -369,6 +369,11 @@ Changelog Please See the [releases tab](https://github.com/edx/xblock-lti-consumer/releases) for the complete changelog. +3.4.6 - 2022-03-31 +------------------ + +* Fix rendering of `lti_1p3_launch_error.html` and `lti_1p3_permission_error.html` templates + 3.4.5 - 2022-03-16 ------------------ diff --git a/lti_consumer/__init__.py b/lti_consumer/__init__.py index 4b73aa061889e46046f750289a2d912294dc2686..e78f3aeb05935b044c3e9b2e2b14df80c3b545aa 100644 --- a/lti_consumer/__init__.py +++ b/lti_consumer/__init__.py @@ -4,4 +4,4 @@ Runtime will load the XBlock class from here. from .apps import LTIConsumerApp from .lti_xblock import LtiConsumerXBlock -__version__ = '3.4.5' +__version__ = '3.4.6' diff --git a/lti_consumer/lti_xblock.py b/lti_consumer/lti_xblock.py index e0ab9a0ba10535820de584f56f2c331bb03615cf..336df6e7abaddbdc3775cce85aecec5afe460f6b 100644 --- a/lti_consumer/lti_xblock.py +++ b/lti_consumer/lti_xblock.py @@ -1166,7 +1166,7 @@ class LtiConsumerXBlock(StudioEditableXBlockMixin, XBlock): str(self.location), # pylint: disable=no-member exc, ) - template = loader.render_mako_template('/templates/html/lti_1p3_launch_error.html', context) + template = loader.render_django_template('/templates/html/lti_1p3_launch_error.html', context) return Response(template, status=400, content_type='text/html') except AssertionError as exc: log.warning( @@ -1175,7 +1175,7 @@ class LtiConsumerXBlock(StudioEditableXBlockMixin, XBlock): self.external_user_id, exc, ) - template = loader.render_mako_template('/templates/html/lti_1p3_permission_error.html', context) + template = loader.render_django_template('/templates/html/lti_1p3_permission_error.html', context) return Response(template, status=403, content_type='text/html') @XBlock.handler diff --git a/lti_consumer/tests/unit/test_lti_xblock.py b/lti_consumer/tests/unit/test_lti_xblock.py index 390438dd3dab84e4f2df08c530c7414fc1b7e128..fbada0498baae8b66b83e515d4a65f84169aea41 100644 --- a/lti_consumer/tests/unit/test_lti_xblock.py +++ b/lti_consumer/tests/unit/test_lti_xblock.py @@ -1293,6 +1293,7 @@ class TestLtiConsumer1p3XBlock(TestCase): response_body = response.body.decode('utf-8') self.assertIn("There was an error while launching the LTI 1.3 tool.", response_body) + self.assertNotIn("% trans", response_body) def test_launch_callback_endpoint_when_using_lti_1p1(self): """ @@ -1397,6 +1398,9 @@ class TestLtiConsumer1p3XBlock(TestCase): # Check response self.assertEqual(response.status_code, 403) + response_body = response.body.decode('utf-8') + self.assertIn("Students don't have permissions to perform", response_body) + self.assertNotIn("% trans", response_body) @patch('lti_consumer.api.get_deep_linking_data') def test_callback_endpoint_dl_content_launch(self, mock_dl_data):