Commit fa53a437 authored by Vincent Pelletier's avatar Vincent Pelletier

Only display error detail when there are errors.

parent 368092f6
...@@ -214,15 +214,17 @@ class GenericSiteStats(object): ...@@ -214,15 +214,17 @@ class GenericSiteStats(object):
append('</tr>') append('</tr>')
def hitTd(hit, status): def hitTd(hit, status):
return '<td class="%s">%s</td>' % (getClassForStatusHit(hit, status), hit) return '<td class="%s">%s</td>' % (getClassForStatusHit(hit, status), hit)
has_errors = False
for status, data_dict in sorted(filtered_status.iteritems(), for status, data_dict in sorted(filtered_status.iteritems(),
key=ITEMGETTER0): key=ITEMGETTER0):
has_errors |= statusIsError(status)
append('<tr><th>%s</th>' % status) append('<tr><th>%s</th>' % status)
append(hitTd(sum(data_dict.itervalues()), status)) append(hitTd(sum(data_dict.itervalues()), status))
for date in column_list: for date in column_list:
append(hitTd(data_dict[date], status)) append(hitTd(data_dict[date], status))
append('</tr>') append('</tr>')
append('</table>') append('</table>')
if self.error_detail: if self.error_detail and has_errors:
def getHitForUrl(referer_counter): def getHitForUrl(referer_counter):
return sum(referer_counter.itervalues()) return sum(referer_counter.itervalues())
filtered_status_url = defaultdict(partial(defaultdict, dict)) filtered_status_url = defaultdict(partial(defaultdict, dict))
......
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