From f14687350130634ce41e0a3b6c26a43b1c5db28e Mon Sep 17 00:00:00 2001 From: xinwen Date: Thu, 15 Apr 2021 14:28:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20key=3D0=20=E4=BF=AE=E6=94=B9=E5=88=B0=20?= =?UTF-8?q?key=3D1=20=E6=97=B6=20parent=5Fkey=20=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/migrations/0069_change_node_key0_to_key1.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/assets/migrations/0069_change_node_key0_to_key1.py b/apps/assets/migrations/0069_change_node_key0_to_key1.py index 4024386dc..deb9b0e70 100644 --- a/apps/assets/migrations/0069_change_node_key0_to_key1.py +++ b/apps/assets/migrations/0069_change_node_key0_to_key1.py @@ -42,7 +42,9 @@ def change_key0_to_key1(apps, schema_editor): key_list = n.key.split(':') key_list[0] = '1' new_key = ':'.join(key_list) + new_parent_key = ':'.join(key_list[:-1]) n.key = new_key + n.parent_key = new_parent_key n.save() print('--> Modify key ( {} > {} )'.format(old_key, new_key))