Skip to content

Commit 347e524

Browse files
committed
[bugfix] handle when we don't have a github repo for a hackathon
1 parent d65187d commit 347e524

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

api/leaderboard/leaderboard_service.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,18 @@ def get_github_leaderboard(event_id: str) -> Dict[str, Any]:
543543
org_name = get_github_organizations(event_id)
544544
org_duration = time.time() - org_start
545545
logger.debug("get_github_organizations took %.2f seconds", org_duration)
546+
547+
if org_name["github_organizations"] == []:
548+
logger.warning("No GitHub organizations found for event ID: %s", event_id)
549+
return {
550+
"github_organizations": [],
551+
"github_repositories": [],
552+
"github_contributors": [],
553+
"github_achievements": [],
554+
"generalStats": [],
555+
"individualAchievements": [],
556+
"teamAchievements": []
557+
}
546558

547559
repos_start = time.time()
548560
repos = get_github_repositories(org_name["github_organizations"][0]["name"])

0 commit comments

Comments
 (0)