def get_projects(self, recipient: Union["Team", "User"]) -> Set[Project]: if isinstance(recipient, User): if recipient.is_superuser or self.organization.flags.allow_joinleave: return self.projects team_ids = self.get_users_by_teams()[recipient.id] else: team_ids = [recipient.id] return get_projects(self.projects, team_ids)
def get_projects(self, user: User) -> Set[Project]: if user.is_superuser or self.organization.flags.allow_joinleave: return self.projects team_ids = self.get_users_by_teams()[user.id] return get_projects(self.projects, team_ids)