mirror of
https://github.com/django/django.git
synced 2025-09-23 18:52:57 +00:00
[py3] Made 212b9826bd
Python 3-friendly
This commit is contained in:
parent
de3ad8bb2d
commit
afc1bd7ab8
3 changed files with 11 additions and 11 deletions
|
@ -391,7 +391,7 @@ def slugify(value):
|
|||
underscores) and converts spaces to hyphens. Also strips leading and
|
||||
trailing whitespace.
|
||||
"""
|
||||
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore')
|
||||
value = unicode(re.sub('[^\w\s-]', '', value).strip().lower())
|
||||
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
|
||||
value = re.sub('[^\w\s-]', '', value).strip().lower()
|
||||
return mark_safe(re.sub('[-\s]+', '-', value))
|
||||
slugify = allow_lazy(slugify, unicode)
|
||||
slugify = allow_lazy(slugify, six.text_type)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue