US #55: Custom fields - Fix asome error when generate diff in history model

remotes/origin/enhancement/email-actions
David Barragán Merino 2015-02-25 16:46:39 +01:00
parent be6e03226b
commit ffe04f2bab
1 changed files with 2 additions and 2 deletions

View File

@ -204,8 +204,8 @@ class HistoryEntry(models.Model):
"deleted": [], "deleted": [],
} }
oldcustattrs = {x["id"]:x for x in self.diff["custom_attributes"][0]} oldcustattrs = {x["id"]:x for x in self.diff["custom_attributes"][0] or []}
newcustattrs = {x["id"]:x for x in self.diff["custom_attributes"][1]} newcustattrs = {x["id"]:x for x in self.diff["custom_attributes"][1] or []}
for aid in set(tuple(oldcustattrs.keys()) + tuple(newcustattrs.keys())): for aid in set(tuple(oldcustattrs.keys()) + tuple(newcustattrs.keys())):
if aid in oldcustattrs and aid in newcustattrs: if aid in oldcustattrs and aid in newcustattrs: