mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
POST_request_promo: skip hidden items.
This commit is contained in:
@@ -3832,7 +3832,7 @@ class ApiController(RedditController):
|
||||
promo_tuples = promote.lottery_promoted_links(srnames, n=10)
|
||||
builder = CampaignBuilder(promo_tuples,
|
||||
wrap=default_thing_wrapper(),
|
||||
keep_fn=promote.is_promoted,
|
||||
keep_fn=promote.promo_keep_fn,
|
||||
num=1,
|
||||
skip=True)
|
||||
listing = LinkListing(builder, nextprev=False).listing()
|
||||
|
||||
@@ -93,6 +93,10 @@ def cost_per_click(spend, clicks):
|
||||
return 0
|
||||
|
||||
|
||||
def promo_keep_fn(item):
|
||||
return is_promoted(item) and not item.hidden
|
||||
|
||||
|
||||
# attrs
|
||||
|
||||
def promo_traffic_url(l): # old traffic url
|
||||
|
||||
Reference in New Issue
Block a user