File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
readthedocs/core/templatetags Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change 1
1
"""Template tags to query projects by privacy."""
2
2
3
3
from django import template
4
- from django .db .models import Exists
5
- from django .db .models import OuterRef
6
4
7
- from readthedocs .builds .models import Build
8
5
from readthedocs .core .permissions import AdminPermission
9
6
from readthedocs .projects .models import Project
10
7
@@ -24,14 +21,9 @@ def is_member(user, project):
24
21
25
22
@register .simple_tag (takes_context = True )
26
23
def get_public_projects (context , user ):
27
- # 'Exists()' checks if the project has any good builds.
28
- projects = (
29
- Project .objects .for_user_and_viewer (
30
- user = user ,
31
- viewer = context ["request" ].user ,
32
- )
33
- .prefetch_latest_build ()
34
- .annotate (_good_build = Exists (Build .internal .filter (success = True , project = OuterRef ("pk" ))))
35
- )
24
+ projects = Project .objects .for_user_and_viewer (
25
+ user = user ,
26
+ viewer = context ["request" ].user ,
27
+ ).prefetch_latest_build ()
36
28
context ["public_projects" ] = projects
37
29
return ""
You can’t perform that action at this time.
0 commit comments