Skip to content

Commit

Permalink
Correction affichage du tag (#3597)
Browse files Browse the repository at this point in the history
  • Loading branch information
orandin authored and GerardPaligot committed May 13, 2016
1 parent 2b0663f commit 0e8c8a9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions zds/tutorialv2/views/views_published.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,8 @@ def get_queryset(self):
self.category = get_object_or_404(SubCategory, slug=self.request.GET.get('category'))
queryset = queryset.filter(content__subcategory__in=[self.category])
if 'tag' in self.request.GET:
self.tag = Tag.objects.filter(title=self.request.GET.get('tag').lower().strip())
if not self.tag:
raise Http404("tag not found " + self.request.GET.get('tag'))
queryset = queryset.filter(content__tags__in=list(self.tag)) # different tags can have same
self.tag = get_object_or_404(Tag, title=self.request.GET.get('tag').lower().strip())
queryset = queryset.filter(content__tags__in=[self.tag]) # different tags can have same
# slug such as C/C#/C++, as a first version we get all of them
queryset = queryset.extra(select={"count_note": sub_query})
return queryset.order_by('-publication_date')
Expand Down

0 comments on commit 0e8c8a9

Please sign in to comment.