login: create invalid file if doesn't exist

master
justcool393 2022-10-26 14:11:30 -05:00
parent 03cf8038f3
commit 782a4494da
1 changed files with 1 additions and 1 deletions

View File

@ -149,7 +149,7 @@ def log_failed_admin_login_attempt(account:User, type:str):
ip = get_CF() ip = get_CF()
print(f"Admin user from {ip} failed to login to account {account.user_name} (invalid {type})!") print(f"Admin user from {ip} failed to login to account {account.user_name} (invalid {type})!")
try: 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()))) t = str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(time.time())))
f.write(f"{t}, {ip}, {account.username}, {type}\n") f.write(f"{t}, {ip}, {account.username}, {type}\n")
except: except: