patch missing client for testing

This commit is contained in:
Michael Genson 2024-01-25 19:10:21 +00:00
parent 098c8194f5
commit a840cb0800

View File

@ -67,7 +67,8 @@ def get_token(
if "," in ip: # if there are multiple IPs, the first one is canonically the true client
ip = str(ip.split(",")[0])
else:
ip = request.client.host
# request.client should never be null, except sometimes during testing
ip = request.client.host if request.client else "unknown"
try:
user = authenticate_user(session, email, password) # type: ignore