Kaydet (Commit) b906c3db authored tarafından Jon Dufresne's avatar Jon Dufresne Kaydeden (comit) Tim Graham

Removed duplicate lines in slugify().

üst eac396a5
......@@ -412,9 +412,8 @@ def slugify(value, allow_unicode=False):
value = force_text(value)
if allow_unicode:
value = unicodedata.normalize('NFKC', value)
value = re.sub(r'[^\w\s-]', '', value).strip().lower()
return mark_safe(re.sub(r'[-\s]+', '-', value))
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
else:
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
value = re.sub(r'[^\w\s-]', '', value).strip().lower()
return mark_safe(re.sub(r'[-\s]+', '-', value))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment