X-Git-Url: https://git.mdrn.pl/django-migdal.git/blobdiff_plain/476685a9de9b8380c5c8ee71d63d6d6020533926..99c8259adb407042592ae3d1879a6617ca29add1:/migdal/api.py diff --git a/migdal/api.py b/migdal/api.py index abd3b21..fd89352 100644 --- a/migdal/api.py +++ b/migdal/api.py @@ -2,14 +2,12 @@ # This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -from itertools import chain from migdal.models import Entry from migdal import app_settings from django.utils.translation import get_language -def entry_list(entry_type=None, category=None, promobox=False, - for_feed=False): +def entry_list(entry_type=None, category=None, promobox=False, for_feed=False): lang = get_language() object_list = Entry.objects.filter(**{"published_%s" % lang: True}) @@ -26,13 +24,11 @@ def entry_list(entry_type=None, category=None, promobox=False, if category: object_list = object_list.filter(categories=category) - if promobox: - promo = list(object_list.filter(promo=True)[:promobox]) - #object_list = object_list.exclude(pk__in=[p.pk for p in promo]) - object_list = object_list.filter(in_stream=True) if promobox: + promo = list(object_list.filter(promo=True)[:promobox]) + # object_list = object_list.exclude(pk__in=[p.pk for p in promo]) object_list.promobox = promo return object_list