From b2ce7667c88e03ea358c26389b257744bae9071d Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Fri, 30 Oct 2015 14:47:55 +0100 Subject: [PATCH] Fixing calculated tags for watched/voted/liked content --- taiga/users/serializers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/taiga/users/serializers.py b/taiga/users/serializers.py index 2a7000fd..759e5a0f 100644 --- a/taiga/users/serializers.py +++ b/taiga/users/serializers.py @@ -236,7 +236,10 @@ class HighLightedContentSerializer(serializers.Serializer): def get_tags_color(self, obj): tags = obj.get("tags", []) - return [{"name": tc[0], "color": tc[1]} for tc in obj.get("tags_colors", []) if tc[0] in tags] + tags = tags if tags is not None else [] + tags_colors = obj.get("tags_colors", []) + tags_colors = tags_colors if tags_colors is not None else [] + return [{"name": tc[0], "color": tc[1]} for tc in tags_colors if tc[0] in tags] def get_is_watcher(self, obj): return obj["id"] in self.user_watching.get(obj["type"], [])