# HG changeset patch # User Goffi # Date 1521014464 -3600 # Node ID 5f97118dc82ab5788b95860ff431172bf7e908f8 # Parent abc5d545dbaa90604d89b451987c7a89a78181f2 pages: fixed min_args for getPathArgs diff -r abc5d545dbaa -r 5f97118dc82a src/server/pages.py --- a/src/server/pages.py Sun Mar 11 19:33:38 2018 +0100 +++ b/src/server/pages.py Wed Mar 14 09:01:04 2018 +0100 @@ -562,6 +562,7 @@ Missing arguments will have None value @param names(list[unicode]): list of arguments to get @param min_args(int): if less than min_args are found, PageError is used with C.HTTP_BAD_REQUEST + use 0 to ignore @param **kwargs: special value or optional callback to use for arguments names of the arguments must correspond to those in names special values may be: @@ -579,6 +580,7 @@ try: value.append(self.nextPath(request)) except IndexError: + idx-=1 break else: idx+=1 @@ -589,7 +591,7 @@ data[name] = None break - if idx < min_args: + if idx + 1 < min_args: log.warning(_(u"Missing arguments in URL (got {idx}, expected at least {min_args})").format( idx = idx, min_args = min_args)) self.pageError(request, C.HTTP_BAD_REQUEST)