Skip to content

Commit 2d9845d

Browse files
committed
Remove Organization (.members and .users) to avoid confusion
These methods came from corporate and we are not really using them in community. Now that corporate is implementing SSO, we need to make some modification on them and we can't include them here. We could re-add them once SSO is brought to community or we can implement them in a different class that we can override with our SettingsOverrideObject method.
1 parent 619ef51 commit 2d9845d

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

readthedocs/organizations/models.py

-29
Original file line numberDiff line numberDiff line change
@@ -92,35 +92,6 @@ def __str__(self):
9292
def get_absolute_url(self):
9393
return reverse('organization_detail', args=(self.slug,))
9494

95-
@property
96-
def users(self):
97-
sso_users = User.objects.none()
98-
# TODO: find another way to check if we are under corporate site
99-
if settings.ALLOW_PRIVATE_REPOS:
100-
from readthedocsinc.acl.sso.models import SSOIntegration # noqa
101-
if SSOIntegration.objects.filter(organization=self).exists():
102-
# TODO: use RemoteRepository.remote_id instead of full_name
103-
full_names = self.projects.values('remote_repository__full_name')
104-
sso_users = User.objects.filter(
105-
oauth_repositories__full_name__in=full_names,
106-
).distinct()
107-
108-
return (
109-
# Members
110-
self.members.all() |
111-
# Owners
112-
self.owners.all().distinct() |
113-
# SSO Users
114-
sso_users
115-
).distinct()
116-
117-
@property
118-
def members(self):
119-
"""Return members as an aggregate over all organization teams."""
120-
return User.objects.filter(
121-
Q(teams__organization=self) | Q(owner_organizations=self),
122-
).distinct()
123-
12495
def save(self, *args, **kwargs): # pylint: disable=arguments-differ
12596
if not self.slug:
12697
self.slug = slugify(self.name)

0 commit comments

Comments
 (0)