Ensure eg log created if not exists.

master
Snakes 2022-12-02 15:34:51 -05:00
parent 9209cf6036
commit 15dc9c4cf7
Signed by: Snakes
GPG Key ID: E745A82778055C7E
1 changed files with 2 additions and 1 deletions

View File

@ -61,7 +61,8 @@ def get_logged_in_user():
if AEVANN_ID and request.headers.get("Cf-Ipcountry") == 'EG':
if v and not v.username.startswith('Aev') and v.truescore > 0:
with open(f"{LOG_DIRECTORY}/eg.log", "r+", encoding="utf-8") as f:
with open(f"{LOG_DIRECTORY}/eg.log", "a+", encoding="utf-8") as f:
f.seek(0)
ip = request.headers.get('CF-Connecting-IP')
if f'@{v.username}, ' not in f.read():
t = time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(time.time()))