From 6b37cd948112dc89b496144ea855c8c193f13592 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= <jan.bednarik@gmail.com>
Date: Sun, 28 Feb 2021 11:18:48 +0100
Subject: [PATCH] uniweb: Fix tags filter for articles

---
 uniweb/models.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/uniweb/models.py b/uniweb/models.py
index d63994b6..51f582d1 100644
--- a/uniweb/models.py
+++ b/uniweb/models.py
@@ -404,7 +404,9 @@ class UniwebArticlesIndexPage(Page, SubpageMixin, MetadataPageMixin):
             articles = articles.filter(uniwebarticlepage__tags__name=tag)
 
         context["articles"] = Paginator(articles, ARTICLES_PER_PAGE).get_page(num)
-        context["tags"] = UniwebArticleTag.tags_for(UniwebArticlePage)
+        context["tags"] = UniwebArticleTag.tags_for(UniwebArticlePage).filter(
+            uniwebarticlepage__in=articles
+        )
         context["active_tag"] = tag
         return context
 
-- 
GitLab