aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2018-05-15 21:46:05 +0200
committerMichael Buesch <m@bues.ch>2018-05-15 21:46:05 +0200
commit34637a45b27985334a32e721827c49fca3f8811f (patch)
tree151b69a40dc1566f25e33f77dd7931a9a70acf36
parent7ae3ce0e4a1e60ad11f6b2c270077152a1c2a2ea (diff)
downloadcms-34637a45b27985334a32e721827c49fca3f8811f.tar.xz
cms-34637a45b27985334a32e721827c49fca3f8811f.zip
Remove empty components from URL paths
Signed-off-by: Michael Buesch <m@bues.ch>
-rw-r--r--cms/cms.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cms/cms.py b/cms/cms.py
index c252629..7a29a86 100644
--- a/cms/cms.py
+++ b/cms/cms.py
@@ -234,11 +234,12 @@ class CMSPageIdent(list):
url.append(domain)
if urlBase:
url.append(urlBase.strip("/"))
- url.extend(self)
+ localPath = [elem for elem in self if elem]
+ url.extend(localPath)
if not protocol and not domain:
url.insert(0, "")
url = "/".join(url)
- if self and pageSuffix:
+ if localPath and pageSuffix:
url += pageSuffix
return url
bues.ch cgit interface