Make get_contentlength more fault tolerent for issue97

This commit is contained in:
Cédric Krier
2008-06-08 19:52:36 +02:00
parent 0e733899c9
commit 8d61d9fe2b
+5 -2
View File
@@ -199,8 +199,11 @@ class Collection(OSV):
attachment_obj = self.pool.get('ir.attachment')
attachment = attachment_obj.browse(cursor, user, object_id,
context=context)
if attachment.datas_size:
return str(attachment.datas_size)
try:
if attachment.datas_size:
return str(attachment.datas_size)
except:
return '0'
return '0'
def get_contenttype(self, cursor, user, uri, context=None):