Mercurial > libervia-web
comparison src/server/pages.py @ 1014:dfced7992460
pages: ignore empty or unset arguments in getURL
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 19 Jan 2018 18:01:01 +0100 |
parents | 841a595bee5a |
children | 16d52917666c |
comparison
equal
deleted
inserted
replaced
1013:841a595bee5a | 1014:dfced7992460 |
---|---|
349 | 349 |
350 def getURL(self, *args): | 350 def getURL(self, *args): |
351 """retrieve URL of the page set arguments | 351 """retrieve URL of the page set arguments |
352 | 352 |
353 *args(list[unicode]): argument to add to the URL as path elements | 353 *args(list[unicode]): argument to add to the URL as path elements |
354 """ | 354 empty or None arguments will be ignored |
355 url_args = [quote(a) for a in args] | 355 """ |
356 url_args = [quote(a) for a in args if a] | |
356 | 357 |
357 if self.name is not None and self.name in self.pages_redirects: | 358 if self.name is not None and self.name in self.pages_redirects: |
358 # we check for redirection | 359 # we check for redirection |
359 redirect_data = self.pages_redirects[self.name] | 360 redirect_data = self.pages_redirects[self.name] |
360 args_hash = tuple(args) | 361 args_hash = tuple(args) |