Skip to content

Commit

Permalink
Merge pull request #171 from rlskoeser/patch-1
Browse files Browse the repository at this point in the history
Make blog post redirect view a permanent / 301 redirect
  • Loading branch information
sarahframe authored Aug 20, 2024
2 parents 70b098e + 19146e5 commit 78a1b99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cdhweb/blog/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class AtomBlogPostFeed(RssBlogPostFeed):

class BlogPostRedirectView(RedirectView):
pattern_name = "blog-detail"
permanent = True

def get_redirect_url(self, *args, **kwargs):
post = get_object_or_404(BlogPost, slug=kwargs["slug"])
return post.url
return post.url

0 comments on commit 78a1b99

Please sign in to comment.