Cleanup and reformat some code

This commit is contained in:
M.Ravi 2018-04-19 09:23:22 +02:00
parent a7f1f14dc7
commit 0b97ae69f5

View file

@ -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()