Commit d5e68aa1 authored by Olga Brani's avatar Olga Brani
Browse files

Fix division by zero

parent 1ea1ddc3
......@@ -1173,7 +1173,10 @@ def resource_list(request):
entry['load_class'] = 'red'
max_value = float(entry['maxValue'])
curr_value = float(entry['currValue'])
entry['ratio'] = (curr_value / max_value) * 100
if max_value > 0 :
entry['ratio'] = (curr_value / max_value) * 100
else:
entry['ratio'] = 0
if entry['ratio'] < 66:
entry['load_class'] = 'yellow'
if entry['ratio'] < 33:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment