Do not fill pygal chart with None value

pygal call max on the values so it raises a TypeError when comparing the
number with None on Python3.

issue8147
review50791002
This commit is contained in:
Cédric Krier
2019-03-04 18:57:08 +01:00
parent fc8e9e0678
commit c8cb5b74c0
+1 -1
View File
@@ -167,7 +167,7 @@ class Abstract(ModelSQL):
name = name[:-len('_trend')]
if pygal:
chart = pygal.Line()
chart.add('', [getattr(ts, name) if ts else None
chart.add('', [getattr(ts, name) if ts else 0
for ts in self.time_series_all])
return chart.render_sparktext()