Skip to content

Commit

Permalink
Update views.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Dec 6, 2024
1 parent 9c540eb commit 623ec2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions atlasserver/forcephot/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 623ec2e

Please sign in to comment.