diff options
| author | Jeremy Chen <jeremy886@gmail.com> | 2017-04-15 19:25:46 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-15 19:25:46 +1000 |
| commit | 4b743ad895e914d31b75d446118d219e36435711 (patch) | |
| tree | fe7ea7efe91b19bb56fdbfdb55d2725bc9bf5868 /docs | |
| parent | 67ac6c8718df02505882d08d254d7a4ab9423d18 (diff) | |
| download | pyramid-4b743ad895e914d31b75d446118d219e36435711.tar.gz pyramid-4b743ad895e914d31b75d446118d219e36435711.tar.bz2 pyramid-4b743ad895e914d31b75d446118d219e36435711.zip | |
Update default.py
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/tutorials/wiki2/src/authentication/tutorial/views/default.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/tutorials/wiki2/src/authentication/tutorial/views/default.py b/docs/tutorials/wiki2/src/authentication/tutorial/views/default.py index 1b071434c..2d058d874 100644 --- a/docs/tutorials/wiki2/src/authentication/tutorial/views/default.py +++ b/docs/tutorials/wiki2/src/authentication/tutorial/views/default.py @@ -1,4 +1,4 @@ -import cgi +from pyramid.compat import escape import re from docutils.core import publish_parts @@ -32,10 +32,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) |
