web/views/urlrewrite.py
branchstable
changeset 3865 f9778a00e47f
parent 3864 2fee9151c6b2
child 3890 d7a270f50f54
child 4212 ab6573088b4a
--- a/web/views/urlrewrite.py	Mon Nov 16 17:51:45 2009 +0100
+++ b/web/views/urlrewrite.py	Mon Nov 16 18:10:51 2009 +0100
@@ -149,10 +149,11 @@
 
 def rgx_action(rql=None, args=None, cachekey=None, argsgroups=(), setuser=False,
                form=None, formgroups=(), transforms={}, controller=None):
-    def do_build_rset(inputurl, uri, req, schema):
+    def do_build_rset(inputurl, uri, req, schema,
+                      cachekey=cachekey # necessary to avoid UnboundLocalError
+                      ):
         if rql:
             kwargs = args and args.copy() or {}
-            cachekey = cachekey # necessary to avoid UnboundLocalError
             if argsgroups:
                 if cachekey is not None and isinstance(cachekey, basestring):
                     cachekey = (cachekey,)
@@ -163,7 +164,7 @@
                         kwargs[key] = transforms[key](value)
                     except KeyError:
                         kwargs[key] = value
-                    if key in cachekey:
+                    if cachekey is not None and key in cachekey:
                         kwargs[key] = typed_eid(value)
             if setuser:
                 kwargs['u'] = req.user.eid