Commit 6d192351 authored by Administrator's avatar Administrator

[BUGFIX] division by zero in view (donut)

parent 18ba0eef
......@@ -165,6 +165,9 @@ def project(request, project_id):
list_corpora[node_resource.resource.type.name].append(corpus_view)
list_corpora = dict(list_corpora)
if docs_total == 0 or docs_total is None:
docs_total = 1
donut = [ {'source': key,
'count': donut_part[key] ,
'part' : round(donut_part[key] * 100 / docs_total) } \
......
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