mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 16:28:01 -05:00
PromoteController: Use _byID36 with id36
This commit is contained in:
committed by
Neil Williams
parent
3c2356c1a5
commit
7a1bc4eef1
@@ -401,17 +401,18 @@ class PromoteController(ListingController):
|
||||
else:
|
||||
min_daily_bid = g.min_promote_bid
|
||||
|
||||
# you cannot edit the bid of a live ad unless it's a freebie
|
||||
try:
|
||||
campaign = PromoCampaign._byID(campaign_id36)
|
||||
if (bid != campaign.bid and
|
||||
campaign.start_date < datetime.now(g.tz)
|
||||
and not campaign.is_freebie()):
|
||||
c.errors.add(errors.BID_LIVE, field='bid')
|
||||
form.has_errors('bid', errors.BID_LIVE)
|
||||
return
|
||||
except NotFound:
|
||||
pass
|
||||
if campaign_id36:
|
||||
# you cannot edit the bid of a live ad unless it's a freebie
|
||||
try:
|
||||
campaign = PromoCampaign._byID36(campaign_id36)
|
||||
if (bid != campaign.bid and
|
||||
campaign.start_date < datetime.now(g.tz)
|
||||
and not campaign.is_freebie()):
|
||||
c.errors.add(errors.BID_LIVE, field='bid')
|
||||
form.has_errors('bid', errors.BID_LIVE)
|
||||
return
|
||||
except NotFound:
|
||||
pass
|
||||
|
||||
if bid is None or bid / duration < min_daily_bid:
|
||||
c.errors.add(errors.BAD_BID, field = 'bid',
|
||||
|
||||
Reference in New Issue
Block a user