From 6d60a729b73e13cb9c8a344f113ee4703bf98701 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Fri, 19 Apr 2024 11:20:30 -0400 Subject: [PATCH] [scrobbles] Just push old data into JSON --- .../scrobbles/migrations/0052_alter_scrobble_scroble_log.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/vrobbler/apps/scrobbles/migrations/0052_alter_scrobble_scroble_log.py b/vrobbler/apps/scrobbles/migrations/0052_alter_scrobble_scroble_log.py index c6be574..4b19115 100644 --- a/vrobbler/apps/scrobbles/migrations/0052_alter_scrobble_scroble_log.py +++ b/vrobbler/apps/scrobbles/migrations/0052_alter_scrobble_scroble_log.py @@ -7,10 +7,7 @@ from django.db import migrations, models def convert_log_to_json(apps, schema_editor): Scrobble = apps.get_model("scrobbles", "Scrobble") for s in Scrobble.objects.filter(scrobble_log__isnull=False): - try: - s.scrobble_log = json.loads(s.scrobble_log) - except json.JSONDecodeError: - s.scrobble_log = json.dumps({"migrated_data": s.scrobble_log}) + s.scrobble_log = json.dumps({"migrated_data": s.scrobble_log}) s.save(update_fields=["scrobble_log"])