From 0b5fff9be075d70abf613f2e473cfa24288c4d47 Mon Sep 17 00:00:00 2001 From: SaintShit Date: Fri, 19 Jul 2024 10:09:03 +0330 Subject: [PATCH] fix: login report --- app/telegram/handlers/report.py | 2 +- app/utils/report.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/telegram/handlers/report.py b/app/telegram/handlers/report.py index 218151ffb..947b50318 100644 --- a/app/telegram/handlers/report.py +++ b/app/telegram/handlers/report.py @@ -184,7 +184,7 @@ def report_login(username: str, password: str, client_ip: str, status: str): """.format( username=escape_html(username), password=escape_html(password), - success=escape_html(status), + status=escape_html(status), client_ip=escape_html(client_ip) ) diff --git a/app/utils/report.py b/app/utils/report.py index 9840ba374..672260e07 100644 --- a/app/utils/report.py +++ b/app/utils/report.py @@ -155,22 +155,24 @@ def expire_days_reached(db: Session, days: int, user: UserResponse, user_id: int db, ReminderType.expiration_date, expires_at=dt.utcfromtimestamp(expire), user_id=user_id) + def login(username: str, password: str, client_ip: str, success: bool) -> None: try: telegram.report_login( username=username, password=password, client_ip=client_ip, - success="✅ Success" if success else "❌ Failed" + status="✅ Success" if success else "❌ Failed" ) - except Exception: + except Exception as exc: + print(exc) pass try: discord.report_login( username=username, password=password, client_ip=client_ip, - success="✅ Success" if success else "❌ Failed" + status="✅ Success" if success else "❌ Failed" ) except Exception: - pass \ No newline at end of file + pass