Пофиксил баг с координатами
This commit is contained in:
@@ -534,13 +534,8 @@ class SourceForm(forms.ModelForm):
|
||||
|
||||
instance = super().save(commit=False)
|
||||
|
||||
# Обработка coords_average
|
||||
avg_lat = self.cleaned_data.get("average_latitude")
|
||||
avg_lng = self.cleaned_data.get("average_longitude")
|
||||
if avg_lat is not None and avg_lng is not None:
|
||||
instance.coords_average = Point(avg_lng, avg_lat, srid=4326)
|
||||
else:
|
||||
instance.coords_average = None
|
||||
# coords_average НЕ обрабатываем здесь - это поле управляется только программно
|
||||
# (через _recalculate_average_coords в модели Source)
|
||||
|
||||
# Обработка coords_kupsat
|
||||
kup_lat = self.cleaned_data.get("kupsat_latitude")
|
||||
|
||||
Reference in New Issue
Block a user