github.lister: Filter out partial repositories which break listing
This commit fixes the repository mapping to model. It broke when the listed repository was either None or missing the id field [1] [1] https://sentry.softwareheritage.org/share/issue/532d682182fc43d6a7a99400e3928811/
This commit is contained in:
parent
99fcd2b3f5
commit
ed73cea771
2 changed files with 6 additions and 1 deletions
|
@ -49,7 +49,8 @@ class GitHubLister(IndexingHttpLister):
|
|||
|
||||
def transport_response_simplified(self, response):
|
||||
repos = response.json()
|
||||
return [self.get_model_from_repo(repo) for repo in repos]
|
||||
return [self.get_model_from_repo(repo)
|
||||
for repo in repos if repo and 'id' in repo]
|
||||
|
||||
def request_headers(self):
|
||||
"""(Override) Set requests headers to send when querying the GitHub API
|
||||
|
|
|
@ -66,6 +66,10 @@
|
|||
"releases_url": "https://api.github.com/repos/mojombo/grit/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/mojombo/grit/deployments"
|
||||
},
|
||||
{
|
||||
"description": "Azure Qu..."
|
||||
},
|
||||
{},
|
||||
{
|
||||
"id": 26,
|
||||
"node_id": "MDEwOlJlcG9zaXRvcnkyNg==",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue