From 0b97ae69f5d3d33f5a136b6b19cc71c1681dc3b6 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Thu, 19 Apr 2018 09:23:22 +0200 Subject: [PATCH] Cleanup and reformat some code --- digitalglarus/views.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/digitalglarus/views.py b/digitalglarus/views.py index a450b413..f99577c5 100644 --- a/digitalglarus/views.py +++ b/digitalglarus/views.py @@ -834,8 +834,9 @@ class ContactView(FormView): def blog(request): tags = ["digitalglarus"] - posts = Post.objects.filter(tags__name__in=tags, publish=True).translated(get_language()) - # posts = Post.objects.filter_by_language(get_language()).filter(tags__name__in=tags, publish=True) + posts = (Post.objects + .filter(tags__name__in=tags, publish=True) + .translated(get_language())) context = { 'post_list': posts, } @@ -843,8 +844,6 @@ def blog(request): def blog_detail(request, slug): - # post = Post.objects.filter_by_language(get_language()).filter(slug=slug).first() - post = Post.objects.translated(get_language(), slug=slug).first() if post is None: raise Http404()