From ffe04f2babbcd084efa640174c1d6303c1df5e1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Wed, 25 Feb 2015 16:46:39 +0100 Subject: [PATCH] US #55: Custom fields - Fix asome error when generate diff in history model --- taiga/projects/history/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/taiga/projects/history/models.py b/taiga/projects/history/models.py index 769ec789..468eb439 100644 --- a/taiga/projects/history/models.py +++ b/taiga/projects/history/models.py @@ -204,8 +204,8 @@ class HistoryEntry(models.Model): "deleted": [], } - oldcustattrs = {x["id"]:x for x in self.diff["custom_attributes"][0]} - newcustattrs = {x["id"]:x for x in self.diff["custom_attributes"][1]} + 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] or []} for aid in set(tuple(oldcustattrs.keys()) + tuple(newcustattrs.keys())): if aid in oldcustattrs and aid in newcustattrs: