From 28320a7bde1306fd2669dcb442dbe3851527b4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 8 Jun 2008 21:23:08 +0200 Subject: [PATCH] Raise DAV_NotFound if exception occurs when retreiving datas for issue98 --- trytond/webdav/webdav.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/trytond/webdav/webdav.py b/trytond/webdav/webdav.py index 144d02e027..7e3130f392 100644 --- a/trytond/webdav/webdav.py +++ b/trytond/webdav/webdav.py @@ -249,8 +249,11 @@ class Collection(OSV): attachment_obj = self.pool.get('ir.attachment') attachment = attachment_obj.browse(cursor, user, object_id, context=context) - if attachment.datas: - return base64.decodestring(attachment.datas) + try: + if attachment.datas: + return base64.decodestring(attachment.datas) + except: + raise DAV_NotFound if object_name == 'ir.action.report' and object_id: report_obj = self.pool.get('ir.action.report') report_id = int(uri.rsplit('/', 1)[-1].rsplit('-',