summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py7
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