Fixed name_to_coords call in ICV

This commit is contained in:
Kumi 2021-04-08 11:32:09 +02:00
parent 6d67541571
commit 6e4ecc4604

View file

@ -6,6 +6,7 @@ from django.urls import reverse
from public.mixins import InConstructionMixin
from .models import Inquiry
from .helpers import name_to_coords
class InquiryCreateView(InConstructionMixin, CreateView):
model = Inquiry
@ -29,6 +30,6 @@ class InquiryCreateView(InConstructionMixin, CreateView):
lon = self.cleaned_data.get("destination_lon", "")
if (not lat) or (not lon):
lon, lat = get_coords(self.cleaned_data.get("destination_name"))
lat, lon = name_to_coords(self.cleaned_data.get("destination_name"))
return Point(lon, lat)