Change output when no emotions found

This commit is contained in:
Ruben 2017-03-11 12:07:40 +01:00
parent 73bfc74340
commit ac95a59cca

View file

@ -78,7 +78,8 @@ class ColourHandler(tornado.web.RequestHandler):
statHtml = "<aside id='stats'>";
if not req_emotion:
statHtml += "<h4>Emoties</h4>"
statHtml += charts.createPie(models.getEmotionFractionsFromArtworks(images))
emotionScores = models.getEmotionFractionsFromArtworks(images)
statHtml += charts.createPie(emotionScores) if len(emotionScores) else "Geen emoties opgegeven"
else:
statHtml += "<h4>Groep</h4>"
statHtml += charts.createPie(models.getGroupFractionsFromArtworks(images))