From 2af6ac504d67225921b6de7727085b6b447ad05c Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 19 Aug 2021 11:13:36 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/signals_handler/authbook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/assets/signals_handler/authbook.py b/apps/assets/signals_handler/authbook.py index f1cb2303c..2a149d57a 100644 --- a/apps/assets/signals_handler/authbook.py +++ b/apps/assets/signals_handler/authbook.py @@ -37,6 +37,6 @@ def on_authbook_post_create(sender, instance, **kwargs): @receiver(pre_save, sender=AuthBook) def on_authbook_pre_create(sender, instance, **kwargs): # 升级版本号 - instance.version = instance.history.all().count() + 1 + instance.version += 1 # 即使在 root 组织也不怕 instance.org_id = instance.asset.org_id