diff src/server/pages.py @ 1071:8f77e36cd51d

pages: fixed args count in getPathArgs
author Goffi <goffi@goffi.org>
date Wed, 21 Mar 2018 19:11:22 +0100
parents 5f97118dc82a
children 63ed5f6bd4eb
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():