[FIX] website_blog: safer check of variables in write call

Some code may call write with only one id instead of a list (e.g. translations,
see #5941) and the call to _postproces_content would fail
This commit is contained in:
Martin Trigaux 2015-03-27 16:27:44 +01:00
parent 7e7ecf36f1
commit 12fc5ea840
1 changed files with 2 additions and 0 deletions

View File

@ -243,6 +243,8 @@ class BlogPost(osv.Model):
return post_id
def write(self, cr, uid, ids, vals, context=None):
if isinstance(ids, (int, long)):
ids = [ids]
if 'content' in vals:
vals['content'] = self._postproces_content(cr, uid, ids[0], vals['content'], context=context)
result = super(BlogPost, self).write(cr, uid, ids, vals, context)