Skip to content

Commit

Permalink
doublon non erratiques
Browse files Browse the repository at this point in the history
  • Loading branch information
artragis committed Apr 17, 2016
1 parent db3634a commit 0f95c48
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions zds/tutorialv2/views/views_published.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,11 @@ 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 = get_object_or_404(Tag, slug=self.request.GET.get('tag'))
queryset = queryset.filter(content__tags__in=[self.tag])
self.tag = Tag.objects.filter(slug=self.request.GET.get('tag').lower())
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
# 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 0f95c48

Please sign in to comment.