rebuild altitudes and level geoms on mapupdate
This commit is contained in:
parent
239708af31
commit
ed2cedaa87
4 changed files with 6 additions and 18 deletions
|
@ -1,9 +0,0 @@
|
|||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'recalculate the map altitudes'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
from c3nav.mapdata.models import AltitudeArea
|
||||
AltitudeArea.recalculate()
|
|
@ -1,9 +0,0 @@
|
|||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'rebuild level geometries'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
from c3nav.mapdata.render.base import LevelGeometries
|
||||
LevelGeometries.rebuild()
|
|
@ -46,5 +46,11 @@ class MapUpdate(models.Model):
|
|||
def save(self, **kwargs):
|
||||
if self.pk is not None:
|
||||
raise TypeError
|
||||
|
||||
from c3nav.mapdata.models import AltitudeArea
|
||||
from c3nav.mapdata.render.base import LevelGeometries
|
||||
AltitudeArea.recalculate()
|
||||
LevelGeometries.rebuild()
|
||||
|
||||
super().save(**kwargs)
|
||||
cache.set('mapdata:last_update', (self.pk, self.datetime), 900)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue