Browse Source

perf: 优化版本号

pull/6687/head
ibuler 3 years ago committed by 老广
parent
commit
2af6ac504d
  1. 2
      apps/assets/signals_handler/authbook.py

2
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

Loading…
Cancel
Save