Skip to content

Instantly share code, notes, and snippets.

@grantmcconnaughey
Created January 5, 2017 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grantmcconnaughey/df3222f525d6fe530e01289c78522c93 to your computer and use it in GitHub Desktop.
Save grantmcconnaughey/df3222f525d6fe530e01289c78522c93 to your computer and use it in GitHub Desktop.
def get_projects(self):
client = Github(self.access_token)
owner_logins = set(org.login for org in client.get_user().get_orgs())
owner_logins.add(self.username)
return Project.objects.filter(owner__login__in=owner_logins)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment