delete unnecessary db.connect()
This commit is contained in:
parent
2eb19bc82c
commit
81051aa73a
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue