fix divide by zero when no HPC slice exists
authorScott Baker <smbaker@gmail.com>
Thu, 15 May 2014 23:17:16 +0000 (16:17 -0700)
committerScott Baker <smbaker@gmail.com>
Thu, 15 May 2014 23:17:16 +0000 (16:17 -0700)
planetstack/core/plus/views.py

index 705f4f6..3c63e16 100644 (file)
@@ -517,6 +517,8 @@ class TenantPickSitesView(View):
 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()