commit | 111702b09e2d82f0e5a94a6f331c5c19789fdbde | [log] [tgz] |
---|---|---|
author | Scott Baker <smbaker@gmail.com> | Thu May 15 16:17:16 2014 -0700 |
committer | Scott Baker <smbaker@gmail.com> | Thu May 15 16:17:16 2014 -0700 |
tree | b710225a46cb49242f671ca73aee2847b05905df | |
parent | a381a412a6ababf6caeccf2b911c9adde71d1f96 [diff] |
fix divide by zero when no HPC slice exists
diff --git a/planetstack/core/plus/views.py b/planetstack/core/plus/views.py index 705f4f6..3c63e16 100644 --- a/planetstack/core/plus/views.py +++ b/planetstack/core/plus/views.py
@@ -517,6 +517,8 @@ class DashboardSummaryAjaxView(View): def get(self, request, **kwargs): def avg(x): + if len(x)==0: + return 0 return float(sum(x))/len(x) sites = getCDNOperatorData().values()