Permalink
Browse files

minor bug fixes and testing of trigger logging

  • Loading branch information...
1 parent 8c2c3c6 commit f33d1f2e0252ef835545d4c3a0b9daa2ef144b94 @alimjiwa alimjiwa committed Mar 17, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 sps/transactions/commands.py
  2. +2 −2 sps/web/app.py
@@ -536,7 +536,7 @@ def process_transaction(self, quote, trigger):
# Put extra money back in users account
extra = trigger.amount - real_amount
- log.debug('Trigger %d: Extra money left over after purchase: %s', extra)
+ log.debug('Trigger %d: Extra money left over after purchase: %s', trigger.id, extra)
user.account_balance += extra
# create or update the StockPurchase for this stock symbol
View
@@ -113,8 +113,8 @@ def checkentry(username, action, money_value, stock_quantity, stock_symbol, file
elif action == 'SET_BUY_AMOUNT':
try:
- if len(stock_symbol) != 0 and float(stock_quantity) > 0 and len(username)!=0:
- return "SET_BUY_AMOUNT," + username + ',' + stock_symbol + ',' + stock_quantity
+ if len(stock_symbol) != 0 and float(money_value) > 0 and len(username)!=0:
+ return "SET_BUY_AMOUNT," + username + ',' + stock_symbol + ',' + money_value
else:
return False
except ValueError:

0 comments on commit f33d1f2

Please sign in to comment.