fix issue w/ tag_category

This commit is contained in:
Kuroshini 2019-12-10 12:42:42 +03:00
parent ed18d1c44d
commit ce5e5f6cb7

View File

@ -39,4 +39,8 @@ class TagCategoryDocument(Document):
to the updating of a lot of items. to the updating of a lot of items.
""" """
if isinstance(related_instance, News): if isinstance(related_instance, News):
return related_instance.tags tag_categories = []
for tag in related_instance.tags.all():
if tag.category not in tag_categories:
tag_categories.append(tag.category)
return tag_categories