From 76305543fa83b825a56bc127de194302dbdb58f4 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Mon, 30 Oct 2017 15:02:49 +1100 Subject: [PATCH] Just glue the netloc and path together rather than using urlunparse - it doesn't need to be a valid URL, just a nice-looking one --- lemoncurry/templatetags/friendly_url.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lemoncurry/templatetags/friendly_url.py b/lemoncurry/templatetags/friendly_url.py index a3ad561..0b45b60 100644 --- a/lemoncurry/templatetags/friendly_url.py +++ b/lemoncurry/templatetags/friendly_url.py @@ -1,5 +1,5 @@ from django import template -from urllib.parse import urlunparse, urlparse +from urllib.parse import urlparse register = template.Library() @@ -7,4 +7,4 @@ register = template.Library() @register.filter def friendly_url(url): (scheme, netloc, path, params, q, fragment) = urlparse(url) - return urlunparse(('', netloc, path, '', '', '')) + return netloc + path