Skip to content

Commit

Permalink
Fix map cloning (#1252) (#1253)
Browse files Browse the repository at this point in the history
* Fix map cloning

* Fix map cloning
  • Loading branch information
mattiagiupponi authored Oct 19, 2022
1 parent 04bab3b commit b6dbafe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion geonode_mapstore_client/migrations/0002_migrate_map_blob.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by Django 3.2.13 on 2022-04-28 07:32
import ast
import base64
import json
from django.db import migrations, connections


Expand Down Expand Up @@ -35,7 +36,10 @@ def migrate_map_forward(apps, schema_editor):
cursor.execute(sql_string)
result = cursor.fetchall()
if result:
to_update['blob'] = result[0][0]
try:
to_update['blob'] = json.loads(result[0][0])
except Exception as e:
to_update['blob'] = result[0][0]

sql_string = f'SELECT name, value from mapstore2_adapter_mapstoreattribute where resource_id={_resource.id};'
'''
Expand Down

0 comments on commit b6dbafe

Please sign in to comment.