From 7118bab5985052c1b5da8b38324cb194994d7a33 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Sat, 1 Aug 2015 13:45:05 +0300 Subject: [PATCH] Fixing A posible Bug in the API getting User Stats --- models/User.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/models/User.py b/models/User.py index db6a3a3..b2b2755 100644 --- a/models/User.py +++ b/models/User.py @@ -43,11 +43,14 @@ def get_stats(user): stats = info["stats"]['micro'] p_data = stats['data'] p_series = stats['series'] - user_index = p_series.index(user.username) - #adding commits - data[0] = data[0] + p_data[user_index][0] - #adding open issues - data[1] = data[1] + p_data[user_index][1] + try: + user_index = p_series.index(user.username) + #adding commits + data[0] = data[0] + p_data[user_index][0] + #adding open issues + data[1] = data[1] + p_data[user_index][1] + except Exception: + pass messages = Message.all().filter('master_id =', user.key().id()) for m in messages.run(): data[2] = data[2] + 1