diff --git a/src/c3nav/mapdata/management/commands/clearcache.py b/src/c3nav/mapdata/management/commands/clearmapcache.py similarity index 100% rename from src/c3nav/mapdata/management/commands/clearcache.py rename to src/c3nav/mapdata/management/commands/clearmapcache.py diff --git a/src/c3nav/mapdata/management/commands/compilealtitudes.py b/src/c3nav/mapdata/management/commands/compilealtitudes.py deleted file mode 100644 index e1e48df8..00000000 --- a/src/c3nav/mapdata/management/commands/compilealtitudes.py +++ /dev/null @@ -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() diff --git a/src/c3nav/mapdata/management/commands/rebuildgeometries.py b/src/c3nav/mapdata/management/commands/rebuildgeometries.py deleted file mode 100644 index a9da9237..00000000 --- a/src/c3nav/mapdata/management/commands/rebuildgeometries.py +++ /dev/null @@ -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() diff --git a/src/c3nav/mapdata/models/update.py b/src/c3nav/mapdata/models/update.py index d2f1505a..92a6eda1 100644 --- a/src/c3nav/mapdata/models/update.py +++ b/src/c3nav/mapdata/models/update.py @@ -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)