fix space geometries broken by bug in editor

This commit is contained in:
Laura Klünder 2018-12-10 23:42:01 +01:00
parent d7ab4e02b3
commit 6125ea6d65

View file

@ -0,0 +1,23 @@
# Generated by Django 2.1.4 on 2018-12-10 22:38
from django.db import migrations
from shapely.geometry import Polygon
def fix_broken_spaces(apps, schema_editor):
Space = apps.get_model('mapdata', 'Space')
for space in Space.objects.all():
geometry = space.geometry
space.geometry = Polygon(shell=geometry.exterior)
space.save()
class Migration(migrations.Migration):
dependencies = [
('mapdata', '0001_squashed_2018'),
]
operations = [
migrations.RunPython(fix_broken_spaces, migrations.RunPython.noop)
]