1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-01-24 12:47:05 +00:00

Fixed G004 (logging-f-string): Logging statement uses f-string

This commit is contained in:
Teal Dulcet 2025-01-12 06:50:13 -08:00
parent 554a161648
commit 9d9e900ca2

View File

@ -161,7 +161,7 @@ def login():
"api_key": auth_service.create_session_key(email, env, type='login'),
}
app.logger.info(f"New login session created for {email}")
app.logger.info("New login session created for %s", email)
# Return.
return json_response(resp)
@ -170,7 +170,7 @@ def login():
def logout():
try:
email, _ = auth_service.authenticate(request, env, logout=True)
app.logger.info(f"{email} logged out")
app.logger.info("%s logged out", email)
except ValueError:
pass
finally:
@ -746,7 +746,7 @@ def log_failed_login(request):
# We need to add a timestamp to the log message, otherwise /dev/log will eat the "duplicate"
# message.
app.logger.warning( f"Mail-in-a-Box Management Daemon: Failed login attempt from ip {ip} - timestamp {time.time()}")
app.logger.warning("Mail-in-a-Box Management Daemon: Failed login attempt from ip %s - timestamp %s", ip, time.time())
# APP