diff --git a/database.py b/database.py index 8d8b99b..c305828 100644 --- a/database.py +++ b/database.py @@ -85,7 +85,7 @@ class User(TableDeclarativeBase): return self.first_name def __repr__(self): - return f"" + return f"" class Product(TableDeclarativeBase): @@ -199,7 +199,7 @@ class Transaction(TableDeclarativeBase): return string def __repr__(self): - return f"" + return f"" class Admin(TableDeclarativeBase): @@ -258,7 +258,7 @@ class Order(TableDeclarativeBase): joined_self = session.query(Order).filter_by(order_id=self.order_id).join(Transaction).one() items = "" for item in self.items: - items += str(item) + "\n" + items += item.text(loc=loc) + "\n" if self.delivery_date is not None: status_emoji = loc.get("emoji_completed") status_text = loc.get("text_completed") diff --git a/worker.py b/worker.py index c037f05..468b4f6 100644 --- a/worker.py +++ b/worker.py @@ -1129,9 +1129,11 @@ class Worker(threading.Thread): self.session.commit() # Notify the user of the credit/debit self.bot.send_message(user.user_id, - self.loc.get("notification_transaction_created", transaction=str(transaction))) + self.loc.get("notification_transaction_created", + transaction=transaction.text(loc=self.loc))) # Notify the admin of the success - self.bot.send_message(self.chat.id, self.loc.get("success_transaction_created", transaction=str(transaction))) + self.bot.send_message(self.chat.id, self.loc.get("success_transaction_created", + transaction=transaction.text(loc=self.loc))) def __help_menu(self): """Help menu. Allows the user to ask for assistance, get a guide or see some info about the bot."""