コード例 #1
0
    def POST_freebie(self, form, jquery, link, campaign):
        if campaign_has_oversold_error(form, campaign):
            form.set_html(".freebie", "target oversold, can't freebie")
            return

        if promote.is_promo(link) and campaign:
            promote.free_campaign(link, campaign, c.user)
            form.redirect(promote.promo_edit_url(link))
コード例 #2
0
ファイル: promotecontroller.py プロジェクト: AD42/reddit
    def POST_freebie(self, form, jquery, link, campaign):
        if campaign_has_oversold_error(form, campaign):
            form.set_html(".freebie", "target oversold, can't freebie")
            return

        if promote.is_promo(link) and campaign:
            promote.free_campaign(link, campaign, c.user)
            form.redirect(promote.promo_edit_url(link))
コード例 #3
0
    def POST_freebie(self, form, jquery, link, campaign):
        if not link or not campaign or link._id != campaign.link_id:
            return abort(404, 'not found')

        if campaign_has_oversold_error(form, campaign):
            form.set_text(".freebie", _("target oversold, can't freebie"))
            return

        if promote.is_promo(link) and campaign:
            promote.free_campaign(link, campaign, c.user)
            form.redirect(promote.promo_edit_url(link))
コード例 #4
0
ファイル: promotecontroller.py プロジェクト: 6r3nt/reddit
    def POST_freebie(self, form, jquery, link, campaign):
        if not link or not campaign or link._id != campaign.link_id:
            return abort(404, 'not found')

        if campaign_has_oversold_error(form, campaign):
            form.set_html(".freebie", "target oversold, can't freebie")
            return

        if promote.is_promo(link) and campaign:
            promote.free_campaign(link, campaign, c.user)
            form.redirect(promote.promo_edit_url(link))
コード例 #5
0
ファイル: promotecontroller.py プロジェクト: Chef1991/reddit
 def POST_freebie(self, form, jquery, link, campaign):
     if promote.is_promo(link) and campaign:
         promote.free_campaign(link, campaign, c.user)
         form.redirect(promote.promo_edit_url(link))
コード例 #6
0
ファイル: promotecontroller.py プロジェクト: wal-f/reddit
 def POST_freebie(self, form, jquery, link, campaign):
     if promote.is_promo(link) and campaign:
         promote.free_campaign(link, campaign, c.user)
         form.redirect(promote.promo_edit_url(link))