From d690bec1cbf864718cc335268e8bf0e88d9273c1 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Thu, 14 Oct 2010 14:41:59 +0300 Subject: [PATCH] Doc Webdav: close cursor when dav_get_eprop raises Exceptions. bzr revid: p_christ@hol.gr-20101014114159-ek4fp05fvjygobr2 --- addons/document_webdav/dav_fs.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/document_webdav/dav_fs.py b/addons/document_webdav/dav_fs.py index f6156475231..4665610524e 100644 --- a/addons/document_webdav/dav_fs.py +++ b/addons/document_webdav/dav_fs.py @@ -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):