summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkihiro Motoki <amotoki@gmail.com>2017-06-17 16:44:34 +0000
committerAkihiro Motoki <amotoki@gmail.com>2017-06-17 16:59:10 +0000
commit95d78a140fdb6f24dc3bd87d654e9f927ddfbfa4 (patch)
tree6bcd5c50eab3126ee1034516b614ab09f796b957
parent8f84c0726df4698b1b31454fccc52e4d9ca4c655 (diff)
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
Notes
Notes (review): Code-Review+1: Cao Xuan Hoang <hoangcx@vn.fujitsu.com> Code-Review+1: Debo Zhang <zhangdebo@inspur.com> Code-Review+2: Rob Cresswell <robert.cresswell@outlook.com> Workflow+1: Rob Cresswell <robert.cresswell@outlook.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 19 Jun 2017 11:33:30 +0000 Reviewed-on: https://review.openstack.org/475137 Project: openstack/horizon Branch: refs/heads/master
-rw-r--r--horizon/workflows/base.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/horizon/workflows/base.py b/horizon/workflows/base.py
index 2b2fa29..4c8c4e7 100644
--- a/horizon/workflows/base.py
+++ b/horizon/workflows/base.py
@@ -452,8 +452,7 @@ class Step(object):
452 step_template = template.loader.get_template(self.template_name) 452 step_template = template.loader.get_template(self.template_name)
453 extra_context = {"form": self.action, 453 extra_context = {"form": self.action,
454 "step": self} 454 "step": self}
455 context = template.RequestContext(self.workflow.request, extra_context) 455 return step_template.render(extra_context, self.workflow.request)
456 return step_template.render(context)
457 456
458 def get_help_text(self): 457 def get_help_text(self):
459 """Returns the help text for this step.""" 458 """Returns the help text for this step."""
@@ -891,8 +890,7 @@ class Workflow(html.HTMLElement):
891 extra_context = {"workflow": self} 890 extra_context = {"workflow": self}
892 if self.request.is_ajax(): 891 if self.request.is_ajax():
893 extra_context['modal'] = True 892 extra_context['modal'] = True
894 context = template.RequestContext(self.request, extra_context) 893 return workflow_template.render(extra_context, self.request)
895 return workflow_template.render(context)
896 894
897 def get_absolute_url(self): 895 def get_absolute_url(self):
898 """Returns the canonical URL for this workflow. 896 """Returns the canonical URL for this workflow.