diff --git a/r2/r2/controllers/promotecontroller.py b/r2/r2/controllers/promotecontroller.py index 7cbac6a8b..eb08882a5 100644 --- a/r2/r2/controllers/promotecontroller.py +++ b/r2/r2/controllers/promotecontroller.py @@ -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',