本文整理汇总了Python中r2.lib.emailer.reject_promo函数的典型用法代码示例。如果您正苦于以下问题:Python reject_promo函数的具体用法?Python reject_promo怎么用?Python reject_promo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了reject_promo函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: reject_promo
def reject_promo(thing, reason = ""):
"""
Reject promotion and set its status as rejected
Here, we use unpromote so that we can also remove a promotion from
the queue if it has become promoted.
"""
unpromote(thing, status = STATUS.rejected)
promotion_log(thing, "status update: rejected. Reason: '%s'" % reason)
emailer.reject_promo(thing, reason)
开发者ID:kevinrose,项目名称:diggit,代码行数:10,代码来源:promote.py
示例2: reject_promotion
def reject_promotion(link, reason=None):
was_live = is_promoted(link)
update_promote_status(link, PROMOTE_STATUS.rejected)
# Send a rejection email (unless the advertiser requested the reject)
if not c.user or c.user._id != link.author_id:
emailer.reject_promo(link, reason=reason)
if was_live:
all_live_promo_srnames(_update=True)
开发者ID:j2p2,项目名称:reddit,代码行数:10,代码来源:promote.py
示例3: reject_promotion
def reject_promotion(link, reason=None, notify_why=True):
if is_rejected(link):
return
was_live = is_promoted(link)
update_promote_status(link, PROMOTE_STATUS.rejected)
if reason:
PromotionLog.add(link, "rejected: %s" % reason)
# Send a rejection email (unless the advertiser requested the reject)
if not c.user or c.user._id != link.author_id:
emailer.reject_promo(link, reason=(reason if notify_why else None))
if was_live:
all_live_promo_srnames(_update=True)
开发者ID:pra85,项目名称:reddit,代码行数:15,代码来源:promote.py
示例4: reject_promotion
def reject_promotion(link, reason = None):
PromotionLog.add(link, 'status update: rejected')
# update the query queue
# Since status is updated first,
# if make_daily_promotions happens to run
# while we're doing work here, it will correctly exclude it
set_promote_status(link, PROMOTE_STATUS.rejected)
links, = get_live_promotions([SponsorBoxWeightings.ALL_ADS_ID])[0]
if link._fullname in links:
PromotionLog.add(link, 'Marked promotion for rejection')
queue_changed_promo(link, "rejected")
# Send a rejection email (unless the advertiser requested the reject)
if not c.user or c.user._id != link.author_id:
emailer.reject_promo(link, reason = reason)
开发者ID:vinnydiehl,项目名称:reddit,代码行数:16,代码来源:promote.py
示例5: reject_promotion
def reject_promotion(link, reason = None):
promotion_log(link, "status update: rejected")
# update the query queue
set_status(link, STATUS.rejected)
# check to see if this link is a member of the current live list
links, weighted = get_live_promotions()
if link._fullname in links:
links.remove(link._fullname)
for k in list(weighted.keys()):
weighted[k] = [(lid, w) for lid, w in weighted[k]
if lid != link._fullname]
if not weighted[k]:
del weighted[k]
set_live_promotions((links, weighted))
promotion_log(link, "dequeued")
emailer.reject_promo(link, reason = reason)
开发者ID:XieConnect,项目名称:reddit,代码行数:16,代码来源:promote.py
示例6: reject_promotion
def reject_promotion(link, reason=None):
# update the query queue
# Since status is updated first,
# if make_daily_promotions happens to run
# while we're doing work here, it will correctly exclude it
set_promote_status(link, PROMOTE_STATUS.rejected)
all_ads = get_live_promotions([LiveAdWeights.ALL_ADS])
links = set(x.link for x in all_ads[LiveAdWeights.ALL_ADS])
if link._fullname in links:
PromotionLog.add(link, 'has live campaigns, terminating')
queue_changed_promo(link, "rejected")
# Send a rejection email (unless the advertiser requested the reject)
if not c.user or c.user._id != link.author_id:
emailer.reject_promo(link, reason=reason)
hooks.get_hook('promotion.void').call(link=link)
开发者ID:AD42,项目名称:reddit,代码行数:18,代码来源:promote.py
示例7: reject_promotion
def reject_promotion(link, reason = None):
promotion_log(link, "status update: rejected")
# update the query queue
set_status(link, STATUS.rejected)
# check to see if this link is a member of the current live list
links, weighted = get_live_promotions()
if link._fullname in links:
links.remove(link._fullname)
for k in list(weighted.keys()):
weighted[k] = [(lid, w, cid) for lid, w, cid in weighted[k]
if lid != link._fullname]
if not weighted[k]:
del weighted[k]
set_live_promotions((links, weighted))
promotion_log(link, "dequeued")
# don't send a rejection email when the rejection was user initiated.
if not c.user or c.user._id != link.author_id:
emailer.reject_promo(link, reason = reason)
开发者ID:CryptArc,项目名称:reddit,代码行数:18,代码来源:promote.py
注:本文中的r2.lib.emailer.reject_promo函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论