[FIX] forwardport: forgot token when getting PR commits

So would break any time it needed to fetch the commits of a PR in a
private repo.
This commit is contained in:
Xavier Morel 2019-09-12 14:35:56 +02:00
parent 426bc69ea1
commit 60f4db8687

View File

@ -303,8 +303,10 @@ class PullRequests(models.Model):
), None)
def _commits_lazy(self):
s = requests.Session()
s.headers['Authorization'] = 'token %s' % self.repository.project_id.fp_github_token
for page in itertools.count(1):
r = requests.get('https://api.github.com/repos/{}/pulls/{}/commits'.format(
r = s.get('https://api.github.com/repos/{}/pulls/{}/commits'.format(
self.repository.name,
self.number
), params={'page': page})