fix two bugs

pull/1/head
eric 2014-03-01 17:13:57 -05:00
parent 2a55277302
commit 3986124464
2 changed files with 3 additions and 0 deletions

View File

@ -643,6 +643,7 @@ class Campaign(models.Model):
def update_left(self):
self._current_total=None
if self.type == THANKS:
self.left == Decimal(0.00)
elif self.type == BUY2UNGLUE:

View File

@ -16,6 +16,7 @@ def pledge_transaction(t,user,amount):
else:
success = user.credit.add_to_pledged(amount)
if success:
t.type = PAYMENT_TYPE_AUTHORIZATION
t.max_amount=amount
t.set_credit_approved(amount)
return success
@ -36,6 +37,7 @@ def pay_transaction(t, user, to_user, amount):
'''user has credit, transfer it to rh account'''
success = user.credit.transfer_to(to_user , amount)
if success:
t.type = PAYMENT_TYPE_INSTANT
t.set_executed()
return success