[FIX] website_blog: copy dict correctly

The 'copy_vals' dict would refer to the same 'vals' dict since list are
mutables. This was not the expected behavior.
This commit is contained in:
Romain Derie
2018-01-25 13:09:31 +01:00
parent efd300156b
commit edac5550ec
+1 -1
View File
@@ -209,7 +209,7 @@ class BlogPost(models.Model):
def write(self, vals):
result = True
for post in self:
copy_vals = vals
copy_vals = dict(vals)
if 'website_published' in vals and 'published_date' not in vals and post.published_date <= fields.Datetime.now():
copy_vals['published_date'] = vals['website_published'] and fields.Datetime.now() or False
result &= super(BlogPost, self).write(copy_vals)