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:
shlurbee
2012-06-27 09:35:02 -07:00
parent 6f9f91e753
commit fd4662a34b

View File

@@ -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()