From 7214cd014f0fbe3f87daf0b50d125c99f159d475 Mon Sep 17 00:00:00 2001
From: Julian Rother <julianr@fsmpi.rwth-aachen.de>
Date: Sat, 18 Feb 2017 11:43:00 +0100
Subject: [PATCH] Handle empty x-values in generic stats

---
 stats.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/stats.py b/stats.py
index 347bc71..0f188af 100644
--- a/stats.py
+++ b/stats.py
@@ -29,7 +29,10 @@ def stats_generic(req, param=None):
 	rows = query(statsqueries[req], *(statsqueries[req].count('?')*[param]))
 	res = {'x':[], 'y':[]}
 	for row in rows:
-		res['x'].append(row['x'])
+		if row['x'] != '':
+			res['x'].append(row['x'])
+		else:
+			res['x'].append('leer')
 		res['y'].append(row['y'])
 	return Response(json.dumps(res, default=plotly_date_handler),  mimetype='application/json')
 
-- 
GitLab