Улучшение читаемости

Хотя бы немного
This commit is contained in:
2024-11-20 19:37:05 +03:00
parent f83a05b6c8
commit 5c8bf9b585
2 changed files with 4 additions and 3 deletions

View File

@@ -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')

View File

@@ -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 = 'Ошибка в подключении к базе данных. Свяжитесь с администратором',