added cleareventdata management command

This commit is contained in:
Jenny Danzmayr 2018-12-08 03:37:05 +01:00
parent e4c7fd508e
commit aa180d0946
2 changed files with 75 additions and 1 deletions

View file

@ -130,7 +130,11 @@ class MapUpdate(models.Model):
logger.info('%.3f m² of altitude areas affected.' % changed_geometries.area)
last_processed_update = cls.objects.filter(processed=True).latest().to_tuple
try:
last_processed_update = cls.objects.filter(processed=True).latest().to_tuple
except cls.DoesNotExist:
last_processed_update = (0, 0)
cache.set('mapdata:last_processed_update', last_processed_update, None)
for new_update in new_updates:
logger.info('Applying changed geometries from MapUpdate #%(id)s (%(type)s)...' %