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
This commit is contained in:
parent
9a92bcd3b7
commit
8e77e74cc8
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue