From b3536c19f68cf75dd4eb64cbcca616eaff500471 Mon Sep 17 00:00:00 2001 From: robertem <3456661+RandomGamer342@users.noreply.github.com> Date: Sat, 4 Feb 2017 23:54:45 +0000 Subject: [PATCH] Removes hidden status from items if they are added to stock in the normal way --- text_based.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/text_based.py b/text_based.py index 1e1cb14..82997ed 100755 --- a/text_based.py +++ b/text_based.py @@ -1403,9 +1403,13 @@ much money you're due in credits for the purchase when prompted. for product in self.products: value = max(product.stock, 0)*product.price + self.products[product][1] old_price = product.price + old_hidden = product.hidden product.price = int(ceil(float(value)/(max(product.stock, 0) + self.products[product][0]))) product.stock += self.products[product][0] - print "New stock for %s: %d" % (product.name, product.stock), ("- New price: " + str(product.price) if old_price != product.price else "") + product.hidden = False + print "New stock for %s: %d" % (product.name, product.stock), \ + ("- New price: " + str(product.price) if old_price != product.price else ""),\ + ("- Removed hidden status" if old_hidden != product.hidden else "") try: self.session.commit() print "Success! Transaction performed:"