From 5c8bf9b585fa43ecd679e60baaf3984c3ebf4764 Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Wed, 20 Nov 2024 19:37:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=87=D0=B8=D1=82=D0=B0=D0=B5=D0=BC=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Хотя бы немного --- App/Report/__init__.py | 1 - App/Report/report_model.py | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/App/Report/__init__.py b/App/Report/__init__.py index 948e5c1..a83f370 100644 --- a/App/Report/__init__.py +++ b/App/Report/__init__.py @@ -7,7 +7,6 @@ import json with open(path.join(path.dirname(__file__), 'reports.json')) as f: report_list = json.load(f) - report_bp = Blueprint('report_bp', __name__, template_folder='templates') @report_bp.route('/menu') diff --git a/App/Report/report_model.py b/App/Report/report_model.py index e7d6bd8..223af0b 100644 --- a/App/Report/report_model.py +++ b/App/Report/report_model.py @@ -24,6 +24,7 @@ def sales_report(input_data: dict, view_script: str) -> InfoRespronse: return InfoRespronse((), error_message = 'Отчет не найден', status=False) + _sql = sql_provider.get(f'{view_script}.sql', input_data) result = select_list(current_app.config['db_config'], _sql) if result is None: @@ -38,8 +39,9 @@ def make_report(input_data: dict, report_id: int, proc_name: str) -> InfoRespron return InfoRespronse((), error_message = 'Отчет уже существует', status=False) - test_data = (report_id,*input_data.values()) - result = procedure(current_app.config['db_config'], proc_name, test_data) + + data = (report_id,*input_data.values()) + result = procedure(current_app.config['db_config'], proc_name, data) if result is None: return InfoRespronse((), error_message = 'Ошибка в подключении к базе данных. Свяжитесь с администратором',