From 9d37ebc86063f9a8076c3af9c11c73efe5930124 Mon Sep 17 00:00:00 2001 From: Mokaddem Date: Tue, 2 Aug 2016 16:00:31 +0200 Subject: [PATCH] Fixed a division by 0 in Flask + Harmonized webpage item positioning --- var/www/Flask_server.py | 3 ++- var/www/templates/Moduletrending.html | 2 ++ var/www/templates/trending_graphs/Moduletrending.html | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/var/www/Flask_server.py b/var/www/Flask_server.py index d2772893..42a28bd0 100755 --- a/var/www/Flask_server.py +++ b/var/www/Flask_server.py @@ -243,7 +243,8 @@ 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.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 module_name == "size": member_set.append((keyw, float(keyw_value_size)/float(keyw_value_num))) else: diff --git a/var/www/templates/Moduletrending.html b/var/www/templates/Moduletrending.html index c7c2e88f..d3ddc31b 100644 --- a/var/www/templates/Moduletrending.html +++ b/var/www/templates/Moduletrending.html @@ -61,6 +61,8 @@