Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/stats/template/fileStats.html

Issue 5664623214723072: Issue 1560 - ZeroDivisionError in sitescripts.stats.bin.pagegenerator (Closed)
Patch Set: Created Nov. 12, 2014, 7:43 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/stats/template/fileStats.html
===================================================================
--- a/sitescripts/stats/template/fileStats.html
+++ b/sitescripts/stats/template/fileStats.html
@@ -119,17 +119,23 @@
{%- if not field.filter and not field.hidden and field.name in data %}
<a href="#{{field.name}}">{{field.title}}</a>
{%- endif %}
{%- endfor %}
</div>
{%- if filterFields|length > 0 %}
{%- if filter %}
- {%- set params = {"totalhits": data.hits, "totalbandwidth": data.bandwidth, "field": {"name": None}} %}
+ {%-
+ set params = {
+ "totalhits": data.hits if data.hits != 0 else 1,
Sebastian Noack 2014/11/12 20:13:58 If there are no hits there aren't any. IMO, preten
Wladimir Palant 2014/11/12 20:56:36 Yes, you reviewed that workaround for other occasi
+ "totalbandwidth": data.bandwidth if data.bandwidth != 0 else 1,
+ "field": {"name": None}
+ }
+ %}
{%- else %}
{%- set items = data.day|sortfield("day") %}
{%- set params = {"totalhits": items|sumhits, "totalbandwidth": items|sumbandwidth, "field": {"name": None}} %}
{%- endif %}
<div id="overview" class="block_title">Overview</div>
<div class="block">
<table align="center">
<tr>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld