Add a hook for when bids are edited

This commit is contained in:
David Wick
2014-12-03 10:01:21 -08:00
parent 6992ad4f00
commit 0baff564e5

View File

@@ -296,6 +296,8 @@ def edit_campaign(link, campaign, dates, bid, cpm, target, priority, location):
# if the bid amount changed, cancel any pending transactions
void_campaign(link, campaign, reason='changed_bid')
changed['bid'] = ("$%0.2f" % campaign.bid, "$%0.2f" % bid)
hooks.get_hook('promote.edit_bid').call(
link=link,campaign=campaign, previous=campaign.bid, current=bid)
campaign.bid = bid
if dates[0] != campaign.start_date or dates[1] != campaign.end_date:
original = '%s to %s' % (campaign.start_date, campaign.end_date)