From 4b8a67d2088155598bdcc697fc5f6c9fc290a014 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Mon, 29 Jun 2015 21:03:04 +0300 Subject: [PATCH] API_Github Conecctor HOT fix - weekly --- SE_API/GitHub_API_Connector.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SE_API/GitHub_API_Connector.py b/SE_API/GitHub_API_Connector.py index 33c59b8..66e7479 100644 --- a/SE_API/GitHub_API_Connector.py +++ b/SE_API/GitHub_API_Connector.py @@ -24,7 +24,10 @@ def get_repo_issues(repo_url): def get_repo_weekly_commits(repo_url): url = 'https://api.github.com/repos/' + repo_url + '/stats/participation' + '?client_id=' + githubKeys.getId() + '&client_secret=' + githubKeys.getSecret() req = requests.get(url) - return req.json()['all'] + try: + return req.json()['all'] + except: + return [] def make_macro(stats, info): macro = {'labels': [], 'data': [[0]]}