From 782a4494da30b2a9885ea932ad52de70adceb4c9 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Wed, 26 Oct 2022 14:11:30 -0500 Subject: [PATCH] login: create invalid file if doesn't exist --- files/routes/login.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/login.py b/files/routes/login.py index b1c09fdc8..0954564fd 100644 --- a/files/routes/login.py +++ b/files/routes/login.py @@ -149,7 +149,7 @@ def log_failed_admin_login_attempt(account:User, type:str): ip = get_CF() print(f"Admin user from {ip} failed to login to account {account.user_name} (invalid {type})!") try: - with open(f"/admin_failed_logins", "r+", encoding="utf-8") as f: + with open(f"/admin_failed_logins", "a+", encoding="utf-8") as f: t = str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(time.time()))) f.write(f"{t}, {ip}, {account.username}, {type}\n") except: