Skip to content

Commit 640e866

Browse files
Merge pull request #233 from open-craft/giovanni/fix-django-template-rendering
fix: Fix LTI 1.1 template rendering on LTI 1.1 embeds
2 parents f96d560 + 8c65674 commit 640e866

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,11 @@ Changelog
367367

368368
Please See the [releases tab](https://github.com/edx/xblock-lti-consumer/releases) for the complete changelog.
369369

370+
3.4.3 - 2022-02-01
371+
------------------
372+
373+
* Fix LTI 1.1 template rendering when using embeds in the platform
374+
370375
3.4.2 - 2022-02-01
371376
------------------
372377

lti_consumer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
from .apps import LTIConsumerApp
55
from .lti_xblock import LtiConsumerXBlock
66

7-
__version__ = '3.4.2'
7+
__version__ = '3.4.3'

lti_consumer/lti_1p1/contrib/django.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,5 @@ def lti_embed(
125125

126126
# Render the form template and return the template
127127
loader = ResourceLoader(__name__)
128-
template = loader.render_mako_template('../../templates/html/lti_launch.html', context)
128+
template = loader.render_django_template('../../templates/html/lti_launch.html', context)
129129
return template

lti_consumer/lti_1p1/contrib/tests/test_django.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ def test_custom_parameters_ignore_keyword_args_without_custom_prefix(self, mock_
105105
mock_set_custom_parameters.assert_called_with(expected_custom_parameters)
106106

107107
@patch('lti_consumer.lti_1p1.contrib.django.LtiConsumer1p1.generate_launch_request', Mock(return_value={'a': 1}))
108-
@patch('lti_consumer.lti_1p1.contrib.django.ResourceLoader.render_mako_template')
109-
def test_make_template_rendered_with_correct_context_and_returned(self, mock_render_mako_template):
108+
@patch('lti_consumer.lti_1p1.contrib.django.ResourceLoader.render_django_template')
109+
def test_make_template_rendered_with_correct_context_and_returned(self, mock_render_django_template):
110110
fake_template = 'SOME_TEMPLATE'
111-
mock_render_mako_template.return_value = fake_template
111+
mock_render_django_template.return_value = fake_template
112112

113113
rendered_template = lti_embed(
114114
html_element_id=self.html_element_id,
@@ -132,5 +132,5 @@ def test_make_template_rendered_with_correct_context_and_returned(self, mock_ren
132132
'launch_url': self.lti_launch_url,
133133
'lti_parameters': {'a': 1}
134134
}
135-
mock_render_mako_template.assert_called_with(ANY, expected_context)
135+
mock_render_django_template.assert_called_with(ANY, expected_context)
136136
self.assertEqual(rendered_template, fake_template)

0 commit comments

Comments
 (0)