diff --git a/main/models.py b/main/models.py index 6b8392558b79edff1eba2bcaf53ae008dffe7166..0bceaf7fc29df28502c5e36d063efc09612c3720 100644 --- a/main/models.py +++ b/main/models.py @@ -525,8 +525,8 @@ class MainArticlesPage( self.append_all_shared_articles_query( MainArticlePage.objects.search( request.GET["q"], - custom_article_query=lambda query: query.search(request.GET["q"]), - ) + ), + custom_article_query=lambda query: query.search(request.GET["q"]), ), 10, request.GET.get("page", 1), diff --git a/main/templates/main/includes/person_article_preview.html b/main/templates/main/includes/person_article_preview.html index 4af1c54384f5736989db82fd4fa4a881269a2069..89ead97385706b76cd6108ecf846cad86de6f9a5 100644 --- a/main/templates/main/includes/person_article_preview.html +++ b/main/templates/main/includes/person_article_preview.html @@ -16,7 +16,7 @@ <div class="grid-content-with-right-side flex flex-col justify-between items-start mb-9"> <div class="flex flex-wrap font-bold mb-4 text-xs text-white uppercase"> <span class="mb-1 bg-green-500 mr-1 px-2 py-2">{{ article_page.date }}</span> - {% for tag in article_page.tags.all %} + {% for tag in article_page.get_tags %} <span class="bg-violet-600 mb-1 mr-1 px-2 py-2">{{ tag }}</span> {% endfor %} </div> diff --git a/main/templates/main/includes/work_article_preview.html b/main/templates/main/includes/work_article_preview.html index 7960f89a9917a29ebc435804fb071e3013ae9c5c..6b75ba17bd7c1cefa3d5418fcafde7d4aa732513 100644 --- a/main/templates/main/includes/work_article_preview.html +++ b/main/templates/main/includes/work_article_preview.html @@ -15,7 +15,7 @@ </a> <div class="flex font-bold mb-4 text-xs text-white uppercase"> <span class="bg-green-500 mr-1 p-2">{{ article_page.date }}</span> - {% for tag in article_page.tags.all %} + {% for tag in article_page.get_tags %} <span class="bg-violet-600 mr-1 p-2">{{ tag }}</span> {% endfor %} </div> diff --git a/main/templates/main/main_person_page.html b/main/templates/main/main_person_page.html index 22450572e59608634ddf8620276fb13f08227f55..1d6072a3d7aa17f010756cf819dded5aabfb4d57 100644 --- a/main/templates/main/main_person_page.html +++ b/main/templates/main/main_person_page.html @@ -150,7 +150,7 @@ <div class="grid-content-with-right-side flex flex-col justify-between items-start mb-9"> <div class="flex font-bold mb-4 text-xs text-white uppercase"> <span class="bg-green-500 mr-1 px-2 py-2">{{ article_preview.date }}</span> - {% for tag in article_preview.tags.all %} + {% for tag in article_preview.get_tags %} <span class="bg-violet-600 mr-1 px-2 py-2">{{ tag }}</span> {% endfor %} </div> diff --git a/shared/models.py b/shared/models.py index 14943b91d8945414374a8ce219a00b3386f8ec03..c7941d4c5ef9d7c0f509eff0d8493b8ea51302c1 100644 --- a/shared/models.py +++ b/shared/models.py @@ -583,9 +583,8 @@ class ArticlesMixin(models.Model): lambda article: article.page_ptr.id, filter( lambda article: article.shared_type == page_type - or ( - article.shared_type is None and own_page_type.value == page_type - ), + if article.shared_type is not None + else own_page_type.value == page_type, articles, ), ) diff --git a/shared/templates/styleguide/2.3.x/article_card.html b/shared/templates/styleguide/2.3.x/article_card.html index d5b9108954b6aff3dad958a070abab158d132510..8b98e342554f6b484c810ba0b301b5bc441c77ed 100644 --- a/shared/templates/styleguide/2.3.x/article_card.html +++ b/shared/templates/styleguide/2.3.x/article_card.html @@ -43,7 +43,7 @@ {% if article.has_tags %} <div class="inline-block-nogap mt-4"> - {% for tag in article.tags.all %} + {% for tag in article.get_tags %} <a href="{% pageurl article.tag_filter_page %}?tag={{ tag }}" class="btn article-card__category-button btn--grey-125 btn--condensed text-sm font-light"> <div class="btn__body ">{{ tag }}</div> </a> diff --git a/uniweb/models.py b/uniweb/models.py index 4d38b4fe5ff77792217fa70be732c12246ee131e..0f951727e75a96f4641e353b1eed92793e9ea315 100644 --- a/uniweb/models.py +++ b/uniweb/models.py @@ -558,19 +558,12 @@ class UniwebArticlesIndexPage( else articles, ) - articles_ids = self.append_all_shared_articles_ids_with_type( - own_children, - filter=lambda articles: articles.filter(**tag_params) - if tag is not None - else articles, - ) - context["articles"] = self.get_page_with_shared_articles( articles, ARTICLES_PER_PAGE, num, ) - context["tags"] = self.search_tags_by_unioned_id_query(articles_ids) + context["tags"] = self.search_tags_by_unioned_id_query(articles) context["active_tag"] = tag return context diff --git a/uniweb/templates/uniweb/uniweb_article_page.html b/uniweb/templates/uniweb/uniweb_article_page.html index a627ad0a221d6a8986905bf39a03474d52f0bc86..483fa3aa466f2e85d6d45b5625be5c6656aaf125 100644 --- a/uniweb/templates/uniweb/uniweb_article_page.html +++ b/uniweb/templates/uniweb/uniweb_article_page.html @@ -23,7 +23,7 @@ {% if page.has_tags %} <div class="my-4"> - {% for tag in page.tags.all %} + {% for tag in page.get_tags %} <a href="{% pageurl page.tag_filter_page %}?tag={{ tag }}" class="btn btn--grey-125 btn--condensed"> <div class="btn__body ">{{ tag }}</div> </a>