changeset 1071:8f77e36cd51d

pages: fixed args count in getPathArgs
author Goffi <goffi@goffi.org>
date Wed, 21 Mar 2018 19:11:22 +0100
parents 46622cb54e6c
children 7dc20bacd3b6
files src/server/pages.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/server/pages.py	Sun Mar 18 11:38:34 2018 +0100
+++ b/src/server/pages.py	Wed Mar 21 19:11:22 2018 +0100
@@ -589,14 +589,16 @@
                     value = data[name] = self.nextPath(request)
                 except IndexError:
                     data[name] = None
+                    idx-=1
                     break
 
-        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))
+        values_count = idx+1
+        if values_count < min_args:
+            log.warning(_(u"Missing arguments in URL (got {count}, expected at least {min_args})").format(
+                count = values_count, min_args = min_args))
             self.pageError(request, C.HTTP_BAD_REQUEST)
 
-        for name in names[idx+1:]:
+        for name in names[values_count:]:
             data[name] = None
 
         for name, handler in kwargs.iteritems():