Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c034d60

Browse files
committed
fix api change with ioc
1 parent 3ad7f6a commit c034d60

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

element/node.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ class NodeHandler(object):
77
def finalize(self, request_handler):
88
pass
99

10-
def render(self, request_handler, templating, template_name, params):
10+
def render(self, request_handler, templating, template_name, params=None):
11+
params = params or {}
1112
template = templating.get_template(template_name)
1213

1314
request_handler.write(template.render(params))

element/plugins/contact/contact.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def get_name(self):
3232
def execute(self, request_handler, context):
3333

3434
contact = Contact()
35-
form = ContactForm(TornadoMultiDict(request_handler), contact)
35+
form = ContactForm(TornadoMultiDict(request_handler.request), contact)
3636

3737
params = {
3838
'sent': False,
@@ -62,5 +62,4 @@ def execute(self, request_handler, context):
6262
if 'confirmation' in request_handler.request.arguments:
6363
params['sent'] = True
6464

65-
6665
self.render(request_handler, self.templating, context.settings['template'], params)
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{% extends context.settings.base_template %}
22

33
{% block content %}
4-
<h1>{{ context.node.title }}</h1>
4+
{% if context.node.title %}
5+
<h1>{{ context.node.title }}</h1>
6+
{% endif %}
57

68
{{ content|safe }}
79
{% endblock %}

0 commit comments

Comments
 (0)