From 81051aa73ada5595d7a3afe6067a1625cbd43843 Mon Sep 17 00:00:00 2001 From: Vladyslav Shatrovskyi Date: Tue, 13 Feb 2024 13:05:07 +0200 Subject: [PATCH] delete unnecessary db.connect() --- cancel_order.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cancel_order.py b/cancel_order.py index c24fb8d..9bdd342 100644 --- a/cancel_order.py +++ b/cancel_order.py @@ -7,8 +7,6 @@ from models import EpicenterOrder, CancelReason, db def get_cancel_reason_name(reason_ukr: str): try: - # Connect to the database - db.connect() # Query the CancelReason table cancel_reason = ( @@ -17,9 +15,6 @@ def get_cancel_reason_name(reason_ukr: str): .first() ) - # Close the database connection - db.close() - if cancel_reason: return cancel_reason.name else: