mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-27 00:07:16 +00:00
Fixed bug in flask not correctly displaying the number of paste/providers
This commit is contained in:
parent
14062a549c
commit
084737dd26
1 changed files with 9 additions and 2 deletions
|
@ -305,12 +305,19 @@ def providersChart():
|
|||
keyw_value_size = r_serv_charts.hget(redis_provider_name_size, get_date_range(0)[0])
|
||||
keyw_value_size = keyw_value_size if keyw_value_size is not None else 0.0
|
||||
keyw_value_num = r_serv_charts.hget(redis_provider_name_num, get_date_range(0)[0])
|
||||
keyw_value_num = keyw_value_num if keyw_value_num is not None else 0
|
||||
keyw_value_num = keyw_value_num if int(keyw_value_num) != 0 else 10000000000
|
||||
|
||||
if keyw_value_num is not None:
|
||||
keyw_value_num = int(keyw_value_num)
|
||||
else:
|
||||
if module_name == "size":
|
||||
keyw_value_num = 10000000000
|
||||
else:
|
||||
keyw_value_num = 0
|
||||
if module_name == "size":
|
||||
member_set.append((keyw, float(keyw_value_size)/float(keyw_value_num)))
|
||||
else:
|
||||
member_set.append((keyw, float(keyw_value_num)))
|
||||
|
||||
member_set.sort(key=lambda tup: tup[1], reverse=True)
|
||||
if len(member_set) == 0:
|
||||
member_set.append(("No relevant data", float(100)))
|
||||
|
|
Loading…
Reference in a new issue