[basecontroller] handle case where the query is prefixed by 'rql:' as allowed by the search input stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 14 Sep 2010 15:38:41 +0200
branchstable
changeset 6237 0c886f667b1f
parent 6236 9138f23ee263
child 6238 2f5ebeb7665d
[basecontroller] handle case where the query is prefixed by 'rql:' as allowed by the search input
web/views/basecontrollers.py
--- a/web/views/basecontrollers.py	Tue Sep 14 15:37:32 2010 +0200
+++ b/web/views/basecontrollers.py	Tue Sep 14 15:38:41 2010 +0200
@@ -334,6 +334,9 @@
 
     def _exec(self, rql, args=None, rocheck=True):
         """json mode: execute RQL and return resultset as json"""
+        rql = rql.strip()
+        if rql.startswith('rql:'):
+            rql = rql[4:]
         if rocheck:
             self._cw.ensure_ro_rql(rql)
         try: