Skip to content

Commit

Permalink
fix: login report
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintShit committed Jul 19, 2024
1 parent 2d120a5 commit 0b5fff9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/telegram/handlers/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)

Expand Down
10 changes: 6 additions & 4 deletions app/utils/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
pass

0 comments on commit 0b5fff9

Please sign in to comment.