Switch render() arguments to the new way
Previously template.render() takes Context or RequestContext object but after Django 1.8 the method takes a dict and request as separate arguments. The old way will be dropped in Django 1.10. This commit update the usage based on the Django 1.8 release notes [1]. [1] https://docs.djangoproject.com/en/1.8/ref/templates/upgrading/#get-template-and-select-template Change-Id: I0c180146e499c9e48425c7eb4b73792baa6cdb0c
This commit is contained in:
parent
8f84c0726d
commit
95d78a140f
@ -452,8 +452,7 @@ class Step(object):
|
||||
step_template = template.loader.get_template(self.template_name)
|
||||
extra_context = {"form": self.action,
|
||||
"step": self}
|
||||
context = template.RequestContext(self.workflow.request, extra_context)
|
||||
return step_template.render(context)
|
||||
return step_template.render(extra_context, self.workflow.request)
|
||||
|
||||
def get_help_text(self):
|
||||
"""Returns the help text for this step."""
|
||||
@ -891,8 +890,7 @@ class Workflow(html.HTMLElement):
|
||||
extra_context = {"workflow": self}
|
||||
if self.request.is_ajax():
|
||||
extra_context['modal'] = True
|
||||
context = template.RequestContext(self.request, extra_context)
|
||||
return workflow_template.render(context)
|
||||
return workflow_template.render(extra_context, self.request)
|
||||
|
||||
def get_absolute_url(self):
|
||||
"""Returns the canonical URL for this workflow.
|
||||
|
Loading…
Reference in New Issue
Block a user