mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 16:28:01 -05:00
Read roadblocks from Cassandra.
This commit is contained in:
@@ -93,6 +93,7 @@ from r2.models import (
|
||||
PromoCampaign,
|
||||
PromotionLog,
|
||||
PromotionWeights,
|
||||
PromotedLinkRoadblock,
|
||||
Subreddit,
|
||||
)
|
||||
|
||||
@@ -482,7 +483,7 @@ class PromoteController(ListingController):
|
||||
return
|
||||
if dates and sr:
|
||||
sd, ed = dates
|
||||
promote.roadblock_reddit(sr.name, sd.date(), ed.date())
|
||||
PromotedLinkRoadblock.add(sr, sd, ed)
|
||||
jquery.refresh()
|
||||
|
||||
@validatedForm(VSponsorAdmin(),
|
||||
@@ -496,7 +497,7 @@ class PromoteController(ListingController):
|
||||
def POST_rm_roadblock(self, form, jquery, dates, sr):
|
||||
if dates and sr:
|
||||
sd, ed = dates
|
||||
promote.unroadblock_reddit(sr.name, sd.date(), ed.date())
|
||||
PromotedLinkRoadblock.remove(sr, sd, ed)
|
||||
jquery.refresh()
|
||||
|
||||
@validatedForm(VSponsor('link_id'),
|
||||
@@ -592,7 +593,7 @@ class PromoteController(ListingController):
|
||||
# checking to get the error set in the form, but we can't
|
||||
# check for rate-limiting if there's no subreddit
|
||||
return
|
||||
oversold = promote.is_roadblocked(sr.name, start, end)
|
||||
oversold = PromotedLinkRoadblock.is_roadblocked(sr, start, end)
|
||||
if oversold and not c.user_is_sponsor:
|
||||
msg_params = {"start": oversold[0].strftime('%m/%d/%Y'),
|
||||
"end": oversold[1].strftime('%m/%d/%Y')}
|
||||
|
||||
@@ -30,7 +30,7 @@ from r2.models import Link, Printable, Trophy, bidding, PromoCampaign, Promotion
|
||||
from r2.models import Flair, FlairTemplate, FlairTemplateBySubredditIndex
|
||||
from r2.models import USER_FLAIR, LINK_FLAIR
|
||||
from r2.models import GoldPartnerDealCode
|
||||
from r2.models.promo import NO_TRANSACTION, PromotionLog
|
||||
from r2.models.promo import NO_TRANSACTION, PromotionLog, PromotedLinkRoadblock
|
||||
from r2.models.token import OAuth2Client, OAuth2AccessToken
|
||||
from r2.models import traffic
|
||||
from r2.models import ModAction
|
||||
@@ -3430,7 +3430,7 @@ class PromoAdminTool(Reddit):
|
||||
|
||||
class Roadblocks(Templated):
|
||||
def __init__(self):
|
||||
self.roadblocks = promote.get_roadblocks()
|
||||
self.roadblocks = PromotedLinkRoadblock.get_roadblocks()
|
||||
Templated.__init__(self)
|
||||
# reference "now" to what we use for promtions
|
||||
now = promote.promo_datetime_now()
|
||||
|
||||
Reference in New Issue
Block a user