• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python emailer.reject_promo函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python filters._force_unicode函数代码示例发布时间:2022-05-26
下一篇:
Python emailer.queue_promo函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap