From 623ec2e67e89903469fbd09aaae5622df7ec6081 Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Fri, 6 Dec 2024 00:15:31 +0000 Subject: [PATCH] Update views.py --- atlasserver/forcephot/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atlasserver/forcephot/views.py b/atlasserver/forcephot/views.py index 8870f3a..92ca960 100644 --- a/atlasserver/forcephot/views.py +++ b/atlasserver/forcephot/views.py @@ -224,7 +224,7 @@ def perform_create(self, serializer) -> None: geoip = GeoIP2() location = geoip.city(ip) extra_fields["country_code"] = location["country_code"] - extra_fields["region"] = location["city"] + extra_fields["region"] = location["region_code"] extra_fields["from_api"] = "HTTP_REFERER" not in self.request.META serializer.save(**extra_fields) @@ -378,7 +378,7 @@ def get(self, request, pk): geoip = GeoIP2() location = geoip.city(ip) data["country_code"] = location["country_code"] - data["region"] = location["city"] + data["region"] = location["region_code"] data["from_api"] = False data["send_email"] = False