From 0f9ec2ce7db98848db53ebb014e16ee95a2f0c0d Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Thu, 9 Jul 2020 14:56:46 +0200 Subject: [PATCH] Fix ZeroDivisionError in question statistics --- src/pretix/control/views/item.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pretix/control/views/item.py b/src/pretix/control/views/item.py index 93c39e3bcd..d7e7e1959f 100644 --- a/src/pretix/control/views/item.py +++ b/src/pretix/control/views/item.py @@ -566,7 +566,7 @@ class QuestionView(EventPermissionRequiredMixin, QuestionMixin, ChartContainingV r = list(qs) total = sum(a['count'] for a in r) for a in r: - a['percentage'] = a['count'] / total * 100. + a['percentage'] = (a['count'] / total * 100.) if total else 0 return r def get_context_data(self, **kwargs):