From c9d18b62da39b8835e4e4edc16f5edd40cc079ad Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Wed, 11 Dec 2024 23:43:07 +0300 Subject: [PATCH 1/3] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=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 From fb8e97472f5bd27e162c2f16a2fd693e2044a4b0 Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Thu, 12 Dec 2024 02:21:37 +0300 Subject: [PATCH 2/3] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=B3=D0=BE=D0=BD=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=BE=D0=B4=20=D0=A0=D0=9F=D0=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Report/static/js/check.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } From 165a826cd0b53232b6feec33a2ec711a892c459a Mon Sep 17 00:00:00 2001 From: Anton Kamalov Date: Thu, 12 Dec 2024 10:31:03 +0300 Subject: [PATCH 3/3] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=B4=D0=B5=D0=B1=D0=B0=D0=B3-=D0=B8=D0=BD=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/cache/wrapper.py | 2 +- App/checker.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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]: