Fix user transaction error and other unexpected behaviour
This commit is contained in:
parent
17c2d05294
commit
31e3442c7c
|
@ -92,8 +92,8 @@ much money you're due in credits for the purchase when prompted.\n'''
|
|||
|
||||
def perform_transaction(self):
|
||||
print 'Did you pay a different price?'
|
||||
if self.confirm('>', default=True):
|
||||
price = self.input_int()
|
||||
if self.confirm('>', default=False):
|
||||
price = self.input_int('How much did you pay?', default=self.price)
|
||||
if price > self.price:
|
||||
print 'Illegal action, total can not be higher than your total.'
|
||||
else:
|
||||
|
|
|
@ -34,7 +34,7 @@ class TransferMenu(Menu):
|
|||
print 'Transfered %d kr from %s to %s' % (amount, user1, user2)
|
||||
print 'User %s\'s credit is now %d kr' % (user1, user1.credit)
|
||||
print 'User %s\'s credit is now %d kr' % (user2, user2.credit)
|
||||
print 'Comment: $s' % comment
|
||||
print 'Comment: %s' % comment
|
||||
except sqlalchemy.exc.SQLAlchemyError, e:
|
||||
print 'Could not perform transfer: %s' % e
|
||||
# self.pause()
|
||||
|
|
|
@ -18,7 +18,7 @@ Put it up somewhere in the vicinity.
|
|||
def _execute(self):
|
||||
self.print_header()
|
||||
|
||||
thing = self.input_thing('Prodct/User> ')
|
||||
thing = self.input_thing('Product/User> ')
|
||||
|
||||
if isinstance(thing, Product):
|
||||
if re.match(r"^[0-9]{13}$", thing.bar_code):
|
||||
|
|
Loading…
Reference in New Issue