diff --git a/website/legacy/urls.py b/website/legacy/urls.py index c71904a..9d909bf 100644 --- a/website/legacy/urls.py +++ b/website/legacy/urls.py @@ -7,5 +7,7 @@ app_name = "legacy" urlpatterns = [ path("posts/index.xml", views.PostsFeedView.as_view()), path("index.xml", views.AllPagesFeedView.as_view()), - path("tags//", views.TagsView.as_view()), + path("tags//", views.TagView.as_view()), + path("tags/", views.TagView.as_view()), + path("categories/", views.TagView.as_view()), ] diff --git a/website/legacy/views.py b/website/legacy/views.py index b517583..02b1a87 100644 --- a/website/legacy/views.py +++ b/website/legacy/views.py @@ -19,8 +19,14 @@ class AllPagesFeedView(RedirectView): @method_decorator(cache_control(max_age=60 * 60), name="dispatch") -class TagsView(RedirectView): +class TagView(RedirectView): def get_redirect_url(self, slug: str) -> str: - get_object_or_404(BlogPostTagListPage) tag = get_object_or_404(BlogPostTagPage, slug=slug) return tag.get_url(request=self.request) + + +@method_decorator(cache_control(max_age=60 * 60), name="dispatch") +class TagsView(RedirectView): + def get_redirect_url(self) -> str: + tag_list = get_object_or_404(BlogPostTagListPage) + return tag_list.get_url(request=self.request)