diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-03-15 17:05:43 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:21:00 +0100 |
commit | 6803fa0cb2d70eb90591ec318d9733ddea387315 (patch) | |
tree | 1e48546125087a3b16ff9afcae784461d7f51a97 /ishtar_common/models_common.py | |
parent | e426f8ef82dfa1f2c976fb08edec7014dc682bb9 (diff) | |
download | Ishtar-6803fa0cb2d70eb90591ec318d9733ddea387315.tar.bz2 Ishtar-6803fa0cb2d70eb90591ec318d9733ddea387315.zip |
Geodata: fix search display
Diffstat (limited to 'ishtar_common/models_common.py')
-rw-r--r-- | ishtar_common/models_common.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index a7f9bd2fd..414e63c55 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -2132,11 +2132,13 @@ class GeoVectorData(models.Model): name += f" ({str(self.data_type).lower()})" return name - def display_coordinates(self, rounded=5, dim=2, cache=True): - srid = None - profile = get_current_profile() - if profile.display_srs and profile.display_srs.srid: - srid = profile.display_srs.srid + def display_coordinates(self, rounded=5, dim=2, srid=4326, cache=True): + if not srid: + profile = get_current_profile() + if profile.display_srs and profile.display_srs.srid: + srid = profile.display_srs.srid + else: + srid = 4326 return self.get_coordinates(rounded=rounded, srid=srid, dim=dim, cache=cache) def get_coordinates(self, rounded=5, srid: int = None, dim=2, cache=False): |