diff options
| author | Jeremy Chen <jeremy886@gmail.com> | 2017-04-15 19:28:27 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-15 19:28:27 +1000 |
| commit | 9d961de6cef714391683e24d4616d0db2a9e931d (patch) | |
| tree | 8099b5078b96d832c359ceb5e130660cf6f805e0 /docs/tutorials | |
| parent | edf56847ab136c0fc358309e584edd15357c5848 (diff) | |
| download | pyramid-9d961de6cef714391683e24d4616d0db2a9e931d.tar.gz pyramid-9d961de6cef714391683e24d4616d0db2a9e931d.tar.bz2 pyramid-9d961de6cef714391683e24d4616d0db2a9e931d.zip | |
Update default.py
Diffstat (limited to 'docs/tutorials')
| -rw-r--r-- | docs/tutorials/wiki2/src/tests/tutorial/views/default.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/tutorials/wiki2/src/tests/tutorial/views/default.py b/docs/tutorials/wiki2/src/tests/tutorial/views/default.py index 9358993ea..65c12ed3b 100644 --- a/docs/tutorials/wiki2/src/tests/tutorial/views/default.py +++ b/docs/tutorials/wiki2/src/tests/tutorial/views/default.py @@ -1,4 +1,4 @@ -import cgi +from pyramid.compat import escape import re from docutils.core import publish_parts @@ -25,10 +25,10 @@ def view_page(request): exists = request.dbsession.query(Page).filter_by(name=word).all() if exists: view_url = request.route_url('view_page', pagename=word) - return '<a href="%s">%s</a>' % (view_url, cgi.escape(word)) + return '<a href="%s">%s</a>' % (view_url, escape(word)) else: add_url = request.route_url('add_page', pagename=word) - return '<a href="%s">%s</a>' % (add_url, cgi.escape(word)) + return '<a href="%s">%s</a>' % (add_url, escape(word)) content = publish_parts(page.data, writer_name='html')['html_body'] content = wikiwords.sub(add_link, content) |
