aboutsummaryrefslogtreecommitdiff
path: root/jb/views/utils.py
diff options
context:
space:
mode:
authorMax Nanis2026-02-24 17:26:15 -0500
committerMax Nanis2026-02-24 17:26:15 -0500
commit8c1940445503fd6678d0961600f2be81622793a2 (patch)
treeb9173562b8824b5eaa805e446d9d780e1f23fb2a /jb/views/utils.py
parent25d8c3c214baf10f6520cc1351f78473150e5d7a (diff)
downloadamt-jb-8c1940445503fd6678d0961600f2be81622793a2.tar.gz
amt-jb-8c1940445503fd6678d0961600f2be81622793a2.zip
Extensive use of type checking. Movement of pytest conf towards handling managers (for db agnostic unittest). Starting to organize pytests.
Diffstat (limited to 'jb/views/utils.py')
-rw-r--r--jb/views/utils.py7
1 files changed, 5 insertions, 2 deletions
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