'Get authenticated user projects, or token authed projects
Allow for a user to either be authed to receive a project, or require
the integration token to be specified as a POST argument.'

def get_project(self, **kwargs):

    if self.request.user.is_authenticated():
        try:
            return Project.objects.for_admin_user(self.request.user).get(**kwargs)
        except Project.DoesNotExist:
            pass
    token = self.request.data.get('token')
    if token:
        integration = self.get_integration()
        obj = Project.objects.get(**kwargs)
        is_valid = ((integration.project == obj) and (token == getattr(integration, 'token', None)))
        if is_valid:
            return obj
    raise Project.DoesNotExist()
