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 diff --git a/App/Report/static/js/check.js b/App/Report/static/js/check.js index 230c5ac..1358ccd 100644 --- a/App/Report/static/js/check.js +++ b/App/Report/static/js/check.js @@ -1,7 +1,7 @@ function check_month(now_month, now_year) { let selected_month = document.getElementById('month').value; let selected_year = document.getElementById('year').value; - if (selected_month > now_month && selected_year == now_year) { + if (selected_month > now_month && selected_year == now_year || selected_year > now_year) { alert('Невозможно сформировать отчет за будущий период!'); return false; } diff --git a/App/cache/wrapper.py b/App/cache/wrapper.py index ab4e96e..e4a0bba 100644 --- a/App/cache/wrapper.py +++ b/App/cache/wrapper.py @@ -21,7 +21,7 @@ def fetch_from_cache(cache_name: str, cache_config: dict): if cached_value: return cached_value response = f(*args, **kwargs) - print("response=", response) + # print("response=", response) cache_conn.set_value(cache_name, response, ttl) return response diff --git a/App/checker.py b/App/checker.py index ef3473c..352b734 100644 --- a/App/checker.py +++ b/App/checker.py @@ -11,7 +11,7 @@ def check_auth(func): return redirect(url_for("auth_bp.auth")) user_role = session.get("role") user_request = request.endpoint - print("request_endpoint=", user_request) + # print("request_endpoint=", user_request) user_bp = user_request.split(".")[0] access = current_app.config["db_access"] if user_role in access and user_bp in access[user_role]: