1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-14 10:53:30 +02:00

Make it more readable

This commit is contained in:
Florent Daigniere 2021-10-16 15:12:20 +02:00
parent 94bbed9746
commit 98742268e6

View File

@ -36,10 +36,12 @@ def nginx_authentication():
response.headers['Auth-Wait'] = '3'
return response
is_valid_user = True
if headers.get('Auth-Status') != 'OK':
utils.limiter.rate_limit_user(username, client_ip) if is_valid_user else rate_limit_ip(client_ip)
elif headers["Auth-Status"] == "OK":
if headers.get("Auth-Status") == "OK":
utils.limiter.exempt_ip_from_ratelimits(client_ip)
elif is_valid_user:
utils.limiter.rate_limit_user(username, client_ip)
else:
rate_limit_ip(client_ip)
return response
@internal.route("/auth/admin")