From 8e77e74cc86a4e7a4fb67aa7b977c4852731fff2 Mon Sep 17 00:00:00 2001 From: Luigi Toscano Date: Fri, 28 Jul 2017 15:48:25 +0200 Subject: [PATCH] Switch render() arguments to the new way The object returned by get_template() and select_template() is different and its render() method has a different signature (no more Context or RequestContext) after Django 1.8. The old way was removed in 1.11. See also the relase notes for Django 1.8: https://docs.djangoproject.com/en/1.8/ref/templates/upgrading/#get-template-and-select-template Inspired by https://review.openstack.org/#/c/475137/ Depends-On: I25e294a1c2f721a2f57dd50acb4c5e408b6187f9 Change-Id: I0f9af1f1d1a084b97a3809615a431a4f0bddf5d3 --- .../content/data_processing/clusters/wizard/forms.py | 3 +-- .../content/data_processing/jobs/job_binaries/forms.py | 3 +-- sahara_dashboard/content/data_processing/jobs/wizard/forms.py | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/sahara_dashboard/content/data_processing/clusters/wizard/forms.py b/sahara_dashboard/content/data_processing/clusters/wizard/forms.py index 59f77d28..dc91a498 100644 --- a/sahara_dashboard/content/data_processing/clusters/wizard/forms.py +++ b/sahara_dashboard/content/data_processing/clusters/wizard/forms.py @@ -78,8 +78,7 @@ class ChoosePluginForm(forms.SelfHandlingForm): extra_context = extra_context or {} if self.help_text_template: tmpl = template.loader.get_template(self.help_text_template) - context = template.RequestContext(self.request, extra_context) - text += tmpl.render(context) + text += tmpl.render(extra_context, self.request) else: text += defaultfilters.linebreaks(force_text(self.help_text)) return defaultfilters.safe(text) diff --git a/sahara_dashboard/content/data_processing/jobs/job_binaries/forms.py b/sahara_dashboard/content/data_processing/jobs/job_binaries/forms.py index 5d15802d..173c6288 100644 --- a/sahara_dashboard/content/data_processing/jobs/job_binaries/forms.py +++ b/sahara_dashboard/content/data_processing/jobs/job_binaries/forms.py @@ -270,8 +270,7 @@ class JobBinaryCreateForm(forms.SelfHandlingForm): extra_context = extra_context or {} if self.help_text_template: tmpl = template.loader.get_template(self.help_text_template) - context = template.RequestContext(self.request, extra_context) - text += tmpl.render(context) + text += tmpl.render(extra_context, self.request) else: text += defaultfilters.linebreaks(force_text(self.help_text)) return defaultfilters.safe(text) diff --git a/sahara_dashboard/content/data_processing/jobs/wizard/forms.py b/sahara_dashboard/content/data_processing/jobs/wizard/forms.py index f91a19c4..cae7db40 100644 --- a/sahara_dashboard/content/data_processing/jobs/wizard/forms.py +++ b/sahara_dashboard/content/data_processing/jobs/wizard/forms.py @@ -76,8 +76,7 @@ class ChoosePluginForm(forms.SelfHandlingForm): extra_context = extra_context or {} if self.help_text_template: tmpl = template.loader.get_template(self.help_text_template) - context = template.RequestContext(self.request, extra_context) - text += tmpl.render(context) + text += tmpl.render(extra_context, self.request) else: text += defaultfilters.linebreaks(force_text(self.help_text)) return defaultfilters.safe(text)