mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 23:39:11 -05:00
Fixes bugs in promotion code:
Updates an occurrence of "index" that should have been changed to campaign._id during the campaign thing reads change. This fixes two bugs: (1) Campaigns were being incorrectly marked with "update failed" when edited by an admin or sponsor even though the update was successful. (2) Campaigns were not being automatically marked as freebies when edited by an admin or sponsor. (These have to be set as freebies in self-serve because they are billed separately.) This change also checks for an empty user string so the update function can be run in paster shell.
This commit is contained in:
@@ -461,7 +461,7 @@ def edit_campaign(link, campaign_id, dates, bid, sr):
|
||||
# make it a freebie, if applicable
|
||||
author = Account._byID(link.author_id, True)
|
||||
if getattr(author, "complimentary_promos", False):
|
||||
free_campaign(link, index, c.user)
|
||||
free_campaign(link, campaign._id, c.user)
|
||||
|
||||
except Exception, e: # record error and rethrow
|
||||
g.log.error("Failed to update PromoCampaign %s on link %d. Error was: %r" %
|
||||
@@ -544,7 +544,7 @@ def auth_campaign(link, campaign_id, user, pay_id):
|
||||
link.promote_status))
|
||||
# notify of campaign creation
|
||||
# update the query queue
|
||||
if user._id == link.author_id and trans_id > 0:
|
||||
if user and (user._id == link.author_id) and trans_id > 0:
|
||||
emailer.promo_bid(link, campaign.bid, campaign.start_date)
|
||||
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user