From cfc0f9043953b60ee63c4b2124f2a45ac00f69b7 Mon Sep 17 00:00:00 2001 From: lijiejie Date: Wed, 23 Aug 2023 20:45:34 +0800 Subject: [PATCH] small fix --- logview/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logview/views.py b/logview/views.py index 24c5705..aefc2d0 100644 --- a/logview/views.py +++ b/logview/views.py @@ -24,7 +24,7 @@ from django.utils.translation import gettext as _ def get_city_by_ip(ip): try: - doc = requests.get('https://whois.pconline.com.cn/ip.jsp?ip=%s' % ip).text + doc = requests.get('https://whois.pconline.com.cn/ip.jsp?ip=%s' % ip).text.strip() city = doc.split(' ')[0] except Exception as e: city = ''