Commit b0b18426 authored by Jérome Perrin's avatar Jérome Perrin

patches/DA: fix type of query passed to db.query

In original Products.ZSQLMethods, this is text, we want to keep the
same semantics and encode only at a lower level.
parent 8a5f5b5b
...@@ -30,7 +30,6 @@ from Acquisition import aq_base, aq_parent ...@@ -30,7 +30,6 @@ from Acquisition import aq_base, aq_parent
from zLOG import LOG, INFO, ERROR from zLOG import LOG, INFO, ERROR
from io import BytesIO from io import BytesIO
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
from Products.ERP5Type.Utils import str2bytes
security = ClassSecurityInfo() security = ClassSecurityInfo()
DA.security = security DA.security = security
...@@ -207,7 +206,7 @@ def DA__call__(self, REQUEST=None, __ick__=None, src__=0, test__=0, **kw): ...@@ -207,7 +206,7 @@ def DA__call__(self, REQUEST=None, __ick__=None, src__=0, test__=0, **kw):
security=getSecurityManager() security=getSecurityManager()
security.addContext(self) security.addContext(self)
try: try:
query = str2bytes(self.template(p, **argdata)) query = self.template(p, **argdata)
except TypeError as msg: except TypeError as msg:
msg = str(msg) msg = str(msg)
if 'client' in msg: if 'client' in msg:
...@@ -223,8 +222,6 @@ def DA__call__(self, REQUEST=None, __ick__=None, src__=0, test__=0, **kw): ...@@ -223,8 +222,6 @@ def DA__call__(self, REQUEST=None, __ick__=None, src__=0, test__=0, **kw):
result=self._cached_result(DB__, query, self.max_rows_, c) result=self._cached_result(DB__, query, self.max_rows_, c)
else: else:
try: try:
# if 'portal_ids' in query:
# LOG("DA query", INFO, "query = %s" %(query,))
result=DB__.query(query, self.max_rows_) result=DB__.query(query, self.max_rows_)
except: except:
LOG("DA call raise", ERROR, "DB = %s, c = %s, query = %s" %(DB__, c, query), error=True) LOG("DA call raise", ERROR, "DB = %s, c = %s, query = %s" %(DB__, c, query), error=True)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment