Fixed keyError new categ

pull/7/head
Sami Mokaddem 2017-11-14 17:02:51 +01:00
parent 2b3a5be907
commit 3ec4bcb7a4
1 changed files with 5 additions and 1 deletions

View File

@ -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