changeset 1110:045e8bdaed4f

pages: ignore args if they are None in getSubPageURL
author Goffi <goffi@goffi.org>
date Thu, 21 Jun 2018 01:19:47 +0200
parents 3a7b2b239d3e
children 4d1c4bd4931a
files src/server/pages.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/server/pages.py	Thu Jun 21 01:19:42 2018 +0200
+++ b/src/server/pages.py	Thu Jun 21 01:19:47 2018 +0200
@@ -491,11 +491,12 @@
         @param page_name(unicode): name of the page to retrieve
             it must be a direct children of current page
         @param *args(list[unicode]): arguments to add as path elements
+            if an arg is None, it will be ignored
         @return (unicode): absolute URL to the sub page
         """
         current_url = self.getCurrentURL(request)
         path, child = self.getSubPageByName(page_name)
-        return os.path.join(u'/', current_url, path, *[quote(a) for a in args])
+        return os.path.join(u'/', current_url, path, *[quote(a) for a in args if a is not None])
 
     def getURLByNames(self, named_path):
         """retrieve URL from pages names and arguments