BuyMenu spør om bekreftelse hvis man prøver å avbryte den etter å ha
lagt inn noe i kjøpet.
This commit is contained in:
parent
c2342397eb
commit
2074bd237f
|
@ -492,6 +492,7 @@ When finished, write an empty line to confirm the purchase.
|
||||||
self.print_header()
|
self.print_header()
|
||||||
self.session = Session()
|
self.session = Session()
|
||||||
self.purchase = Purchase()
|
self.purchase = Purchase()
|
||||||
|
self.exit_confirm_msg=None
|
||||||
while True:
|
while True:
|
||||||
self.print_purchase()
|
self.print_purchase()
|
||||||
self.printc({(False,False): 'Enter user or product identification',
|
self.printc({(False,False): 'Enter user or product identification',
|
||||||
|
@ -508,6 +509,11 @@ When finished, write an empty line to confirm the purchase.
|
||||||
return False
|
return False
|
||||||
continue
|
continue
|
||||||
break
|
break
|
||||||
|
else:
|
||||||
|
# once we get something in the
|
||||||
|
# purchase, we want to protect the
|
||||||
|
# user from accidentally killing it
|
||||||
|
self.exit_confirm_msg='Abort purchase?'
|
||||||
if isinstance(thing, User):
|
if isinstance(thing, User):
|
||||||
Transaction(thing, purchase=self.purchase)
|
Transaction(thing, purchase=self.purchase)
|
||||||
elif isinstance(thing, Product):
|
elif isinstance(thing, Product):
|
||||||
|
|
Loading…
Reference in New Issue