Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correction affichage du tag #3597

Merged
merged 1 commit into from
May 13, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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