From 8c1940445503fd6678d0961600f2be81622793a2 Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Tue, 24 Feb 2026 17:26:15 -0500 Subject: Extensive use of type checking. Movement of pytest conf towards handling managers (for db agnostic unittest). Starting to organize pytests. --- jb/views/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'jb/views/utils.py') diff --git a/jb/views/utils.py b/jb/views/utils.py index 39db5d2..0d08e9b 100644 --- a/jb/views/utils.py +++ b/jb/views/utils.py @@ -8,8 +8,11 @@ def get_client_ip(request: Request) -> str: """ ip = request.headers.get("X-Forwarded-For") if not ip: - ip = request.client.host + ip = request.client.host # type: ignore elif ip == "testclient" or ip.startswith("10."): forwarded = request.headers.get("X-Forwarded-For") - ip = forwarded.split(",")[0].strip() if forwarded else request.client.host + ip = ( + forwarded.split(",")[0].strip() if forwarded else request.client.host # type: ignore + ) + return ip -- cgit v1.2.3