forked from 00dani/lemoncurry
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
This commit is contained in:
parent
71295e30f0
commit
76305543fa
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
from django import template
|
from django import template
|
||||||
from urllib.parse import urlunparse, urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
|
@ -7,4 +7,4 @@ register = template.Library()
|
||||||
@register.filter
|
@register.filter
|
||||||
def friendly_url(url):
|
def friendly_url(url):
|
||||||
(scheme, netloc, path, params, q, fragment) = urlparse(url)
|
(scheme, netloc, path, params, q, fragment) = urlparse(url)
|
||||||
return urlunparse(('', netloc, path, '', '', ''))
|
return netloc + path
|
||||||
|
|
Loading…
Reference in a new issue