aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/halloween/hacktoberstats.py
diff options
context:
space:
mode:
authorGravatar Hedy Li <[email protected]>2020-10-08 03:31:46 +0000
committerGravatar Hedy Li <[email protected]>2020-10-08 03:31:46 +0000
commit1e12cc720b4db72a8b76f19f21456f10a6ef4f8e (patch)
tree19d073862f9ea7afa8f8b23fc586cfca856a9ca1 /bot/exts/halloween/hacktoberstats.py
parentresolve conflicts (diff)
fix for when pr has no labels
Diffstat (limited to 'bot/exts/halloween/hacktoberstats.py')
-rw-r--r--bot/exts/halloween/hacktoberstats.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/exts/halloween/hacktoberstats.py b/bot/exts/halloween/hacktoberstats.py
index 50608d56..f4b8f51c 100644
--- a/bot/exts/halloween/hacktoberstats.py
+++ b/bot/exts/halloween/hacktoberstats.py
@@ -298,6 +298,7 @@ class HacktoberStats(commands.Cog):
continue
topics_query_url = f"https://api.github.com/repos/{shortname}/topics"
+ log.debug("Fetching repo topics for " + shortname + " with url: " + topics_query_url)
async with aiohttp.ClientSession() as session:
async with session.get(topics_query_url, headers=GITHUB_TOPICS_ACCEPT_HEADER) as resp:
jsonresp2 = await resp.json()
@@ -307,6 +308,8 @@ class HacktoberStats(commands.Cog):
# PRs after must be in repo with 'hacktoberfest' topic
# unless it has 'hacktoberfest-accepted' label
+ if not ("labels" in jsonresp.keys()):
+ continue
if ("hacktoberfest" in jsonresp2["names"]) or ("hacktoberfest-accpeted" in jsonresp["labels"]):
outlist.append(itemdict)
return outlist