Sometimes GitHub doesn't return repo permissions
The Projects API isn't actually stable as of today, according to https://developer.github.com/v3/projects/collaborators/. As such, no assumptions can be made about what it returns. In older GitHub Enterprise versions, for instance, the permission key is missing. Change-Id: I3e706a209d263c698e76cb7e6b636d69d608ecc9
This commit is contained in:
parent
f3194ce547
commit
e94f951c0b
|
@ -1052,7 +1052,7 @@ class GithubConnection(BaseConnection):
|
|||
return 'none'
|
||||
|
||||
# get permissions from the data
|
||||
return perms.json()['permission']
|
||||
return perms.json().get('permission', 'none')
|
||||
|
||||
def commentPull(self, project, pr_number, message):
|
||||
github = self.getGithubClient(project)
|
||||
|
|
Loading…
Reference in New Issue