delete unnecessary db.connect()

This commit is contained in:
Vladyslav Shatrovskyi 2024-02-13 13:05:07 +02:00
parent 2eb19bc82c
commit 81051aa73a
1 changed files with 0 additions and 5 deletions

View File

@ -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: