From 2e049eec4bd7d18a317c0453600045f707a3db2d Mon Sep 17 00:00:00 2001 From: Hedy Li Date: Fri, 16 Oct 2020 05:24:11 +0000 Subject: handle no PR for a section --- bot/exts/halloween/hacktoberstats.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bot/exts/halloween/hacktoberstats.py b/bot/exts/halloween/hacktoberstats.py index ebce9c87..6843ded2 100644 --- a/bot/exts/halloween/hacktoberstats.py +++ b/bot/exts/halloween/hacktoberstats.py @@ -217,13 +217,17 @@ class HacktoberStats(commands.Cog): url="https://hacktoberfest.digitalocean.com", icon_url="https://avatars1.githubusercontent.com/u/35706162?s=200&v=4" ) + + # this will handle when no PRs in_review or accepted + review_str = self._build_prs_string(in_review, github_username) or "None" + accepted_str = self._build_prs_string(accepted, github_username) or "None" stats_embed.add_field( name="In Review", - value=self._build_prs_string(in_review, github_username) + value=review_str ) stats_embed.add_field( name="Accepted", - value=self._build_prs_string(accepted, github_username) + value=accepted_str ) logging.info(f"Hacktoberfest PR built for GitHub user '{github_username}'") -- cgit v1.2.3