From c9d18b62da39b8835e4e4edc16f5edd40cc079ad Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Wed, 11 Dec 2024 23:43:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D1=86=D0=B5=D0=B4=D1=83=D1=80=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Database/work.py | 2 ++ App/Report/report_model.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/App/Database/work.py b/App/Database/work.py index e0105c3..c3c9bfe 100644 --- a/App/Database/work.py +++ b/App/Database/work.py @@ -19,6 +19,8 @@ def procedure(db_config, name, args: tuple) -> list: raise ValueError("Cursor not created") else: cursor.callproc(name, args) + result = cursor.fetchone()[0] + return result def transaction(cursor, sql): diff --git a/App/Report/report_model.py b/App/Report/report_model.py index 8578ebd..b143d28 100644 --- a/App/Report/report_model.py +++ b/App/Report/report_model.py @@ -19,7 +19,7 @@ def check_report(input_data: dict) -> bool: db_config = current_app.config["db_config"] result = procedure(db_config, "check_report", tuple(input_data.values())) - if result is None or result["exist"] == 0: + if result is None or result == 0: return False return True