web/views/urlrewrite.py
changeset 10612 84468b90e9c1
parent 10399 5234525560ac
child 10688 fa29f3628a1b
--- a/web/views/urlrewrite.py	Wed Sep 16 11:23:51 2015 +0200
+++ b/web/views/urlrewrite.py	Mon Sep 14 16:03:07 2015 +0200
@@ -19,6 +19,8 @@
 
 import re
 
+from six import string_types
+
 from cubicweb.uilib import domid
 from cubicweb.appobject import AppObject
 
@@ -122,14 +124,14 @@
                 required_groups = None
             if required_groups and not req.user.matching_groups(required_groups):
                 continue
-            if isinstance(inputurl, basestring):
+            if isinstance(inputurl, string_types):
                 if inputurl == uri:
                     req.form.update(infos)
                     break
             elif inputurl.match(uri): # it's a regexp
                 # XXX what about i18n? (vtitle for instance)
                 for param, value in infos.items():
-                    if isinstance(value, basestring):
+                    if isinstance(value, string_types):
                         req.form[param] = inputurl.sub(value, uri)
                     else:
                         req.form[param] = value
@@ -222,7 +224,7 @@
                 required_groups = None
             if required_groups and not req.user.matching_groups(required_groups):
                 continue
-            if isinstance(inputurl, basestring):
+            if isinstance(inputurl, string_types):
                 if inputurl == uri:
                     return callback(inputurl, uri, req, self._cw.vreg.schema)
             elif inputurl.match(uri): # it's a regexp