[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:
parent
7e7ecf36f1
commit
12fc5ea840
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue