diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-02-19 20:12:56 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-04-24 19:38:56 +0200 |
commit | 0e34062d370da99b1c1711a0045bd639d1add20e (patch) | |
tree | a25c51fe15544468460b93825f8b12d926c05de9 /ishtar_common/models.py | |
parent | 34868fbe8f2f733d4d8513c8f5f2b0656f62abff (diff) | |
download | Ishtar-0e34062d370da99b1c1711a0045bd639d1add20e.tar.bz2 Ishtar-0e34062d370da99b1c1711a0045bd639d1add20e.zip |
Geom: fi x, y overload by form - geo tests
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 28e469e31..9dd90de65 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3085,10 +3085,11 @@ class Town(Imported, models.Model): def generate_area(self, force=False): if not force and (self.surface or not self.limit): return - self.surface = self.limit.transform(settings.SURFACE_SRID, - clone=True).area - if not self.surface: + surface = self.limit.transform(settings.SURFACE_SRID, + clone=True).area + if surface > 214748364 or not surface: return False + self.surface = surface self.save() return True |