Skip to content

Commit 11d4037

Browse files
committed
rename class
1 parent 8ce612e commit 11d4037

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

readthedocs/projects/urls/public.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from readthedocs.builds import views as build_views
66
from readthedocs.constants import pattern_opts
77
from readthedocs.projects.views import public
8-
from readthedocs.projects.views.public import ProjectDetailView, ProjectIndex
8+
from readthedocs.projects.views.public import ProjectDetailView, ProjectTagIndex
99
from readthedocs.search import views as search_views
1010

1111

@@ -73,7 +73,7 @@
7373
),
7474
url(
7575
r'^tags/(?P<tag>[-\w]+)/$',
76-
ProjectIndex.as_view(),
76+
ProjectTagIndex.as_view(),
7777
name='projects_tag_detail',
7878
),
7979
]

readthedocs/projects/views/public.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
mimetypes.add_type('application/epub+zip', '.epub')
3838

3939

40-
class ProjectIndex(ListView):
40+
class ProjectTagIndex(ListView):
4141

4242
"""List view of public :py:class:`Project` instances."""
4343

@@ -47,11 +47,8 @@ def get_queryset(self):
4747
queryset = Project.objects.public(self.request.user)
4848
queryset = queryset.exclude(users__profile__banned=True)
4949

50-
if self.kwargs.get('tag'):
51-
self.tag = get_object_or_404(Tag, slug=self.kwargs.get('tag'))
52-
queryset = queryset.filter(tags__slug__in=[self.tag.slug])
53-
else:
54-
self.tag = None
50+
self.tag = get_object_or_404(Tag, slug=self.kwargs.get('tag'))
51+
queryset = queryset.filter(tags__slug__in=[self.tag.slug])
5552

5653
if self.kwargs.get('username'):
5754
self.user = get_object_or_404(

0 commit comments

Comments
 (0)