From 3ca675188b8554ff4255580390eb608aabe63630 Mon Sep 17 00:00:00 2001 From: Chris Van Date: Mon, 23 Apr 2012 20:58:32 -0700 Subject: [PATCH] slice at 6 popular apps --- mkt/browse/templates/browse/helpers/promo_slider.html | 2 +- mkt/browse/views.py | 3 +-- mkt/home/views.py | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/mkt/browse/templates/browse/helpers/promo_slider.html b/mkt/browse/templates/browse/helpers/promo_slider.html index 656a53b744..f74867517c 100644 --- a/mkt/browse/templates/browse/helpers/promo_slider.html +++ b/mkt/browse/templates/browse/helpers/promo_slider.html @@ -10,7 +10,7 @@ {# TODO: Replace previews with promo graphics (bug 744648). #} {% set previews = product.previews %} - {% if preview %} + {% if previews.exists() %} {% set preview = previews.order_by('-created')[0].image_url if feature else previews.order_by('-created')[0].thumbnail_url %} {% endif %} diff --git a/mkt/browse/views.py b/mkt/browse/views.py index 30b1ecb676..e6a5bc993d 100644 --- a/mkt/browse/views.py +++ b/mkt/browse/views.py @@ -3,7 +3,6 @@ import jingo from django.shortcuts import get_object_or_404, redirect import amo -from amo.utils import paginate from addons.models import Category from mkt.search.views import _app_search @@ -24,7 +23,7 @@ def _landing(request, category=None): return jingo.render(request, 'browse/landing.html', { 'category': category, 'featured': featured[:6], - 'popular': paginate(request, popular, count=6) + 'popular': popular[:6] }) diff --git a/mkt/home/views.py b/mkt/home/views.py index 347c65238c..ce137a8b96 100644 --- a/mkt/home/views.py +++ b/mkt/home/views.py @@ -1,8 +1,6 @@ import jingo import waffle -from amo.utils import paginate - from mkt.developers.views import home as devhub_home from mkt.webapps.models import Webapp @@ -12,7 +10,7 @@ def home(request): if not waffle.switch_is_active('unleash-consumer'): return devhub_home featured = Webapp.featured('home')[:6] - popular = paginate(request, Webapp.popular(), count=6) + popular = Webapp.popular()[:6] return jingo.render(request, 'home/home.html', { 'featured': featured, 'popular': popular