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

pull/1/head
Danielle McLean 5 years ago
parent 71295e30f0
commit 76305543fa
Signed by: 00dani
GPG Key ID: 5A5D2D1AFF12EEC5
  1. 4
      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

Loading…
Cancel
Save