[FIX] runbot: fetch member should be able to access token for users

This commit is contained in:
Xavier-Do 2023-01-11 13:35:02 +01:00
parent 06f9f62b1f
commit c9c64bccc7

View File

@ -95,7 +95,7 @@ class RunbotTeam(models.Model):
for team in self:
if team.github_team:
url = f"https://api.github.com/orgs/{team.organisation}/teams/{team.github_team}"
session = _make_github_session(team.project_id.token)
session = _make_github_session(team.project_id.sudo().token)
response = session.get(url)
if response.status_code != 200:
raise UserError(f'Cannot find team {team.github_team}')