Skip to content

Commit 455959c

Browse files
committed
Revert part of r13112 and restore the use of allow_lazy. Breaks agenda page
otherwise. Commit ready for merge. - Legacy-Id: 13123
1 parent 76a3c8b commit 455959c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

ietf/utils/html.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import bleach
66
from html5lib import sanitizer, serializer, tokenizer, treebuilders, treewalkers
77

8-
from django.utils.functional import keep_lazy
8+
from django.utils.functional import allow_lazy
99
from django.utils import six
1010

1111
acceptable_elements = ('a', 'abbr', 'acronym', 'address', 'b', 'big',
@@ -67,7 +67,7 @@ def remove_tags(html, tags):
6767
"""Returns the given HTML sanitized, and with the given tags removed."""
6868
allowed = set(acceptable_elements) - set([ t.lower() for t in tags ])
6969
return bleach.clean(html, tags=allowed)
70-
remove_tags = keep_lazy(remove_tags, six.text_type)
70+
remove_tags = allow_lazy(remove_tags, six.text_type)
7171

7272
def clean_html(html):
7373
return bleach.clean(html)

ietf/utils/text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import unicodedata
55
import textwrap
66

7-
from django.utils.functional import keep_lazy
7+
from django.utils.functional import allow_lazy
88
from django.utils import six
99
from django.utils.safestring import mark_safe
1010

@@ -18,7 +18,7 @@ def xslugify(value):
1818
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
1919
value = re.sub('[^\w\s/-]', '', value).strip().lower()
2020
return mark_safe(re.sub('[-\s/]+', '-', value))
21-
xslugify = keep_lazy(xslugify, six.text_type)
21+
xslugify = allow_lazy(xslugify, six.text_type)
2222

2323
def strip_prefix(text, prefix):
2424
if text.startswith(prefix):

0 commit comments

Comments
 (0)