Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Co-authored-by: Alessio Fabiani <alessio.fabiani@geo-solutions.it>
  • Loading branch information
github-actions[bot] and Alessio Fabiani authored Apr 14, 2022
1 parent 7f724ac commit 8985d10
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions geonode/geoapps/migrations/0006_geoapp_blob_migration.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
# Generated by Django 3.2.4 on 2021-07-05 11:21

from django.contrib.contenttypes.models import ContentType
from django.db import migrations
import json

def convert_geostory_blob(apps, _):
model = apps.get_model('base', 'ResourceBase')
for item in model.objects.filter(resource_type='geostory'):
if isinstance(item.blob, str):
new_blob = json.loads(item.blob)
model.objects.filter(id=item.id).update(blob=new_blob)
rtype = ContentType.objects.get(model="geoapp")
model.objects.filter(id=item.id).update(polymorphic_ctype=rtype)


class Migration(migrations.Migration):
Expand All @@ -21,5 +10,4 @@ class Migration(migrations.Migration):
]

operations = [
migrations.RunPython(convert_geostory_blob, migrations.RunPython.noop)
]

0 comments on commit 8985d10

Please sign in to comment.