Web-services: do not allow to call methods that starts with '_' (=private methods). Add a warning: if a method returns a None value
bzr revid: hda@tinyerp.com-20100309142807-bom0jqwyndkacoo8
This commit is contained in:
parent
34d77959ee
commit
c76cc60bd7
|
@ -115,7 +115,12 @@ class osv_pool(netsvc.Service):
|
|||
cr = db.cursor()
|
||||
try:
|
||||
try:
|
||||
if method.startswith('_'):
|
||||
raise except_osv('Method Error', 'Private method %s can not be calleble.' % (method,))
|
||||
res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
|
||||
if res is None:
|
||||
self.logger.notifyChannel("web-services", netsvc.LOG_WARNING,
|
||||
'Method can not return a None value (crash in XML-RPC)')
|
||||
cr.commit()
|
||||
except Exception:
|
||||
cr.rollback()
|
||||
|
|
Loading…
Reference in New Issue