From 95d78a140fdb6f24dc3bd87d654e9f927ddfbfa4 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Sat, 17 Jun 2017 16:44:34 +0000 Subject: [PATCH] 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 --- horizon/workflows/base.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/horizon/workflows/base.py b/horizon/workflows/base.py index 2b2fa293d3..4c8c4e7823 100644 --- a/horizon/workflows/base.py +++ b/horizon/workflows/base.py @@ -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.