'Get access token for project by iterating over project users'

@classmethod
def get_token_for_project(cls, project, force_local=False):

    if (not getattr(settings, 'ALLOW_PRIVATE_REPOS', False)):
        return None
    token = None
    try:
        if (getattr(settings, 'DONT_HIT_DB', True) and (not force_local)):
            token = api.project(project.pk).token().get()['token']
        else:
            for user in project.users.all():
                tokens = SocialToken.objects.filter(account__user=user, app__provider=cls.adapter.provider_id)
                if tokens.exists():
                    token = tokens[0].token
    except Exception:
        log.error('Failed    to    get    token    for    project', exc_info=True)
    return token
