diff --git a/publications/__init__.py b/publications/__init__.py index fa5ab62..212919e 100644 --- a/publications/__init__.py +++ b/publications/__init__.py @@ -5,7 +5,7 @@ import string import sys -__version__ = "9.5.0" +__version__ = "9.5.1" class Constants: diff --git a/publications/label.py b/publications/label.py index 41f21b2..59b24e3 100644 --- a/publications/label.py +++ b/publications/label.py @@ -4,6 +4,7 @@ import io import tornado.web +import tornado.escape from publications import constants from publications import settings @@ -58,6 +59,7 @@ def get(self, identifier): publications=list( publications.subset.Subset(self.db, label=label["value"]) ), + escaped_label=tornado.escape.url_escape(label['value']), ) @tornado.web.authenticated @@ -200,17 +202,17 @@ class LabelEdit(RequestHandler): def get(self, identifier): self.check_admin() try: - label = self.get_label(identifier) + label = self.get_label(tornado.escape.url_unescape(identifier)) except KeyError as error: self.see_other("labels", error=str(error)) return - self.render("label/edit.html", label=label) + self.render("label/edit.html", label=label, escaped_label=identifier) @tornado.web.authenticated def post(self, identifier): self.check_admin() try: - label = self.get_label(identifier) + label = self.get_label(tornado.escape.url_unescape(identifier)) except KeyError as error: self.see_other("labels", error=str(error)) return diff --git a/publications/templates/label/display.html b/publications/templates/label/display.html index c1539e5..2496c30 100644 --- a/publications/templates/label/display.html +++ b/publications/templates/label/display.html @@ -64,7 +64,7 @@ {% block meta_content %} {% if is_admin %}

- Edit diff --git a/publications/templates/label/edit.html b/publications/templates/label/edit.html index f029ed0..c6c3fed 100644 --- a/publications/templates/label/edit.html +++ b/publications/templates/label/edit.html @@ -11,7 +11,7 @@ {% end %} {# block body_title #} {% block main_content %} -

{% module xsrf_form_html() %}