Fix get_priority_for_index method for non-int values

Fixes #1607
This commit is contained in:
Joseph Schorr 2016-07-11 15:04:50 -04:00
parent 3044f8ecbd
commit 541764d87b

View file

@ -97,8 +97,13 @@ PRIORITY_LEVELS = {
def get_priority_for_index(index): def get_priority_for_index(index):
try:
int_index = int(index)
except ValueError:
return 'Unknown'
for priority in PRIORITY_LEVELS: for priority in PRIORITY_LEVELS:
if PRIORITY_LEVELS[priority]['index'] == index: if PRIORITY_LEVELS[priority]['index'] == int_index:
return priority return priority
return 'Unknown' return 'Unknown'