diff --git a/apps/addons/templates/addons/home.html b/apps/addons/templates/addons/home.html index 9d9c6ad66f..b04e7d6375 100644 --- a/apps/addons/templates/addons/home.html +++ b/apps/addons/templates/addons/home.html @@ -6,6 +6,7 @@ {% endblock %} {% block site_stats %} +{% if downloads and pings %}
+{% endif %} {% endblock %} {% set view_all = { diff --git a/apps/addons/views.py b/apps/addons/views.py index eeaf1480cd..cbfe96d898 100644 --- a/apps/addons/views.py +++ b/apps/addons/views.py @@ -64,9 +64,12 @@ class HomepageFilter(object): def home(request): - gs = GlobalStat.objects - downloads = gs.filter(name='addon_total_downloads').latest() - pings = gs.filter(name='addon_total_updatepings').latest() + try: + gs = GlobalStat.objects + downloads = gs.filter(name='addon_total_downloads').latest() + pings = gs.filter(name='addon_total_updatepings').latest() + except GlobalStat.DoesNotExist: + downloads = pings = None q = Collection.objects.filter(listed=True, application=request.APP.id) collections = q.order_by('-weekly_subscribers')[:3]