From 62f3d648d4686304dc15218f8ca284f230239b3c Mon Sep 17 00:00:00 2001 From: Cristian Date: Wed, 7 Oct 2020 09:46:10 -0500 Subject: [PATCH] fix: reverse_func functional --- archivebox/core/migrations/0006_auto_20200915_2006.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/archivebox/core/migrations/0006_auto_20200915_2006.py b/archivebox/core/migrations/0006_auto_20200915_2006.py index 59bb111e..e6b9c66a 100644 --- a/archivebox/core/migrations/0006_auto_20200915_2006.py +++ b/archivebox/core/migrations/0006_auto_20200915_2006.py @@ -43,10 +43,11 @@ def reverse_func(apps, schema_editor): db_alias = schema_editor.connection.alias snapshots = SnapshotModel.objects.all() for snapshot in snapshots: - for tag in tags: - tagged_items = TaggedItemModel.objects.filter( - object_id=snapshot.id, - ).delete() + tags = TaggedItemModel.objects.filter( + object_id=snapshot.id, + ) + snapshot.tags_old = ",".join([tag.tag.name for tag in tags]) + snapshot.save() class Migration(migrations.Migration):