diff --git a/combo_plugin_gnm/views.py b/combo_plugin_gnm/views.py index bec9a9e..ad02463 100644 --- a/combo_plugin_gnm/views.py +++ b/combo_plugin_gnm/views.py @@ -117,9 +117,9 @@ def stats(request, *args, **kwargs): data['users']['have-more-than-suggested-tiles'] = len(manual_tiles_by_user.keys()) data['users']['have-no-tiles'] = data['users']['count'] - data['users']['have-tiles'] dashboard_lengths = [len(x) for x in tiles_by_user.values()] - dashboard_lengths.sort() - data['users']['max-tiles'] = max(dashboard_lengths) if dashboard_lengths: + dashboard_lengths.sort() + data['users']['max-tiles'] = max(dashboard_lengths) data['users']['median-tiles'] = dashboard_lengths[len(dashboard_lengths) // 2] return JsonResponse(data)