From ce5e5f6cb79012f64ec0cbdad985803ea48a24f3 Mon Sep 17 00:00:00 2001 From: Kuroshini Date: Tue, 10 Dec 2019 12:42:42 +0300 Subject: [PATCH] fix issue w/ tag_category --- apps/search_indexes/documents/tag_category.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/search_indexes/documents/tag_category.py b/apps/search_indexes/documents/tag_category.py index cd2c8a90..757483bf 100644 --- a/apps/search_indexes/documents/tag_category.py +++ b/apps/search_indexes/documents/tag_category.py @@ -39,4 +39,8 @@ class TagCategoryDocument(Document): to the updating of a lot of items. """ if isinstance(related_instance, News): - return related_instance.tags \ No newline at end of file + tag_categories = [] + for tag in related_instance.tags.all(): + if tag.category not in tag_categories: + tag_categories.append(tag.category) + return tag_categories \ No newline at end of file