1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-16 17:47:23 +01:00

Fixed UP032 (f-string): Use f-string instead of format call

This commit is contained in:
Teal Dulcet
2023-12-22 07:14:00 -08:00
committed by Joshua Tauberer
parent b7f70b17ac
commit 2b426851f9
7 changed files with 24 additions and 30 deletions

View File

@@ -80,7 +80,7 @@ def authorized_personnel_only(viewfunc):
# Not authorized. Return a 401 (send auth) and a prompt to authorize by default.
status = 401
headers = {
'WWW-Authenticate': 'Basic realm="{0}"'.format(auth_service.auth_realm),
'WWW-Authenticate': f'Basic realm="{auth_service.auth_realm}"',
'X-Reason': error,
}
@@ -164,7 +164,7 @@ def login():
"api_key": auth_service.create_session_key(email, env, type='login'),
}
app.logger.info("New login session created for {}".format(email))
app.logger.info(f"New login session created for {email}")
# Return.
return json_response(resp)
@@ -173,7 +173,7 @@ def login():
def logout():
try:
email, _ = auth_service.authenticate(request, env, logout=True)
app.logger.info("{} logged out".format(email))
app.logger.info(f"{email} logged out")
except ValueError as e:
pass
finally: