pref: 修改信号创建 accounts

pull/9029/head
ibuler 2022-11-08 10:41:06 +08:00
parent 2e784311d3
commit df14d01859
1 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,7 @@
from django.db.models.signals import post_save
from django.dispatch import receiver
from orgs.utils import tmp_to_builtin_org
from .models import Applet, AppletHost
@ -13,7 +14,8 @@ def on_applet_host_create(sender, instance, created=False, **kwargs):
return
applets = Applet.objects.all()
instance.applets.set(applets)
instance.generate_accounts()
with tmp_to_builtin_org(system=1):
instance.generate_accounts()
@receiver(post_save, sender=Applet)