Don't show promos without paid campaigns in "future_promos".

This commit is contained in:
Brian Simpson
2013-12-17 14:37:32 -05:00
parent 19be2d267d
commit 4ab1d14bab

View File

@@ -201,6 +201,14 @@ class PromoteController(ListingController):
def keep_fn(self):
def keep(item):
if self.sort == "future_promos":
# this sort is used to review links that need to be approved
# skip links that don't have any paid campaigns
campaigns = list(PromoCampaign._by_link(item._id))
if not any(promote.authed_or_not_needed(camp)
for camp in campaigns):
return False
if item.promoted and not item._deleted:
return True
else: