Skip to content

Commit 33ece5f

Browse files
committed
Only return SSO Projects if the organization has SSO enabled
1 parent a2bddc3 commit 33ece5f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

readthedocs/organizations/querysets.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ def for_user(self, user=None):
2323
# Add organizations where the user has GitHub SSO projects
2424
# TODO: change this Subquery once we have normalized our db
2525
# https://github.com/readthedocs/readthedocs.org/pull/7169
26-
orgs |= self.filter(projects__remote_repository__full_name__in=Subquery(user.oauth_repositories.values('full_name')))
26+
orgs |= self.filter(
27+
projects__remote_repository__full_name__in=Subquery(user.oauth_repositories.values('full_name')),
28+
ssointegration__isnull=False,
29+
)
2730
return orgs.distinct()
2831

2932
def for_admin_user(self, user=None, include_all=False):

0 commit comments

Comments
 (0)