From 3ec4bcb7a42b320014b1ff02f19baac8f9020beb Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Tue, 14 Nov 2017 17:02:51 +0100 Subject: [PATCH] Fixed keyError new categ --- contributor_helper.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contributor_helper.py b/contributor_helper.py index edb574a..e7e6f00 100644 --- a/contributor_helper.py +++ b/contributor_helper.py @@ -235,7 +235,11 @@ class Contributor_helper: for item in newTrophy: categ = item['categ'] rank = item['trophy_true_rank'] - if rank > temp[categ]: + try: + oldCategRank = temp[categ] + except KeyError: + oldCategRank = 0 + if rank > oldCategRank: awards_given.append(['trophy', [categ, rank]]) return awards_given