Doc Webdav: close cursor when dav_get_eprop raises Exceptions.

bzr revid: p_christ@hol.gr-20101014114159-ek4fp05fvjygobr2
This commit is contained in:
P. Christeas 2010-10-14 14:41:59 +03:00
parent 82aa9ea653
commit d690bec1cb
1 changed files with 6 additions and 5 deletions

View File

@ -215,12 +215,13 @@ class openerp_dav_handler(dav_interface):
if not dbname:
if cr: cr.close()
raise DAV_NotFound
node = self.uri2object(cr, uid, pool, uri2)
if not node:
try:
node = self.uri2object(cr, uid, pool, uri2)
if not node:
raise DAV_NotFound
res = node.get_dav_eprop(cr, ns, propname)
finally:
cr.close()
raise DAV_NotFound
res = node.get_dav_eprop(cr, ns, propname)
cr.close()
return res
def get_db(self, uri, rest_ret=False, allow_last=False):