diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-11-28 18:51:16 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-11-28 18:56:45 +0100 |
commit | aac25d8d954eec47cb6211f58cb1f89d3bbc34d1 (patch) | |
tree | 50cf303bccffad3eda1030ba7ef43f254f507d6a /ishtar_common/views.py | |
parent | 20954e71e00a2199dde84eb9d5aa42e3bcb155fa (diff) | |
download | Ishtar-aac25d8d954eec47cb6211f58cb1f89d3bbc34d1.tar.bz2 Ishtar-aac25d8d954eec47cb6211f58cb1f89d3bbc34d1.zip |
🐛 New Geo item form: center map widget on the center of the main geo item or use default center of the instance (#5676)
Diffstat (limited to 'ishtar_common/views.py')
-rw-r--r-- | ishtar_common/views.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 2ab7e970d..db493fd37 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -2938,6 +2938,9 @@ class GeoCreateView(GeoFormMixin, CreateView): kwargs["source_content_type"] = content_type.pk kwargs["source_id"] = obj.pk kwargs["geom_type"] = self.kwargs.get("geom_type") + main_geodata = obj.main_geodata + if main_geodata and main_geodata.cached_x and main_geodata.cached_y: + kwargs["default_center"] = (main_geodata.cached_x, main_geodata.cached_y) kwargs["user"] = self.request.user return kwargs |