old_contents: # Generated by Django 3.0.14 on 2021-04-14 13:08
  from bluebottle.clients.utils import LocalTenant
  from django.db import migrations, connection
  
  
  def migrate_points(apps, schema_editor):
      Client = apps.get_model('clients', 'Client')
      GeoLocation = apps.get_model('geo', 'GeoLocation')
      Location = apps.get_model('geo', 'Location')
      Place = apps.get_model('geo', 'Place')
      tenant = Client.objects.get(schema_name=connection.tenant.schema_name)
  
      with LocalTenant(tenant):
          for geo in GeoLocation.objects.all():
              geo.position = geo.old_position
              geo.save()
          for geo in Location.objects.all():
              geo.position = geo.old_position
              geo.save()
          for geo in Place.objects.all():
              geo.position = geo.old_position
              geo.save()
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('geo', '0024_auto_20210414_1508'),
      ]
  
      operations = [
          migrations.RunPython(
              migrate_points,
              migrations.RunPython.noop
          )
      ]
  
new_contents: # Generated by Django 3.0.14 on 2021-04-14 13:08
  from bluebottle.clients.utils import LocalTenant
  from django.db import migrations, connection
  from django.contrib.gis.geos import Point
  
  
  def get_point(chars):
      try:
          lattitude, longitude = chars.split(',')
  
          return Point(float(longitude), float(lattitude))
      except (ValueError, AttributeError):
          return None
  
  
  def migrate_points(apps, schema_editor):
      Client = apps.get_model('clients', 'Client')
      GeoLocation = apps.get_model('geo', 'GeoLocation')
      Location = apps.get_model('geo', 'Location')
      Place = apps.get_model('geo', 'Place')
      tenant = Client.objects.get(schema_name=connection.tenant.schema_name)
  
      with LocalTenant(tenant):
          for geo in GeoLocation.objects.all():
              geo.position = get_point(geo.old_position)
              geo.save()
          for geo in Location.objects.all():
              geo.position = get_point(geo.old_position)
              geo.save()
          for geo in Place.objects.all():
              geo.position = get_point(geo.old_position)
              geo.save()
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('geo', '0024_auto_20210414_1508'),
      ]
  
      operations = [
          migrations.RunPython(
              migrate_points,
              migrations.RunPython.noop
          )
      ]
  
subject: Fix migration