File tree 2 files changed +5
-8
lines changed
2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 5
5
from readthedocs .builds import views as build_views
6
6
from readthedocs .constants import pattern_opts
7
7
from readthedocs .projects .views import public
8
- from readthedocs .projects .views .public import ProjectDetailView , ProjectIndex
8
+ from readthedocs .projects .views .public import ProjectDetailView , ProjectTagIndex
9
9
from readthedocs .search import views as search_views
10
10
11
11
73
73
),
74
74
url (
75
75
r'^tags/(?P<tag>[-\w]+)/$' ,
76
- ProjectIndex .as_view (),
76
+ ProjectTagIndex .as_view (),
77
77
name = 'projects_tag_detail' ,
78
78
),
79
79
]
Original file line number Diff line number Diff line change 37
37
mimetypes .add_type ('application/epub+zip' , '.epub' )
38
38
39
39
40
- class ProjectIndex (ListView ):
40
+ class ProjectTagIndex (ListView ):
41
41
42
42
"""List view of public :py:class:`Project` instances."""
43
43
@@ -47,11 +47,8 @@ def get_queryset(self):
47
47
queryset = Project .objects .public (self .request .user )
48
48
queryset = queryset .exclude (users__profile__banned = True )
49
49
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 ])
55
52
56
53
if self .kwargs .get ('username' ):
57
54
self .user = get_object_or_404 (
You can’t perform that action at this time.
0 commit comments