mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Make is_charged_transaction safer
Returns False immediately if trans_id is 0 since this value means no record has been created and therefore the transaction can't have been charged.
This commit is contained in:
@@ -153,6 +153,7 @@ def void_transaction(user, trans_id, campaign, test = None):
|
||||
|
||||
|
||||
def is_charged_transaction(trans_id, campaign):
|
||||
if not trans_id: return False # trans_id == 0 means no bid
|
||||
bid = Bid.one(transaction = trans_id, campaign = campaign)
|
||||
return bid.is_charged()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user