Fix build full absolute url when no request

This commit is contained in:
Gabriel Augendre 2020-12-27 19:56:50 +01:00
parent 99b5f9544e
commit 6b52f6b2b2
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4

View file

@ -5,4 +5,4 @@ def build_full_absolute_url(request, url):
if request:
return request.build_absolute_uri(url)
else:
return (settings.BLOG["base_url"] + url).replace("//", "/")
return (settings.BLOG["base_url"] + url)[::-1].replace("//", "/", 1)[::-1]