(cls, subscription: SystemMsgSubscription)
兼容操作，试图用 `settings.SECURITY_INSECURE_COMMAND_EMAIL_RECEIVER` 的邮件地址
        assets_systemuser_assets找到用户，把用户设置为默认接收者
兼容操作，试图用 `settings.SECURITY_INSECURE_COMMAND_EMAIL_RECEIVER` 的邮件地址
        assets_systemuser_assets找到用户，把用户设置为默认接收者
兼容操作，试图用 settings . SECURITY_INSECURE_COMMAND_EMAIL_RECEIVER 的邮件地址 assets_systemuser_assets找到用户，把用户设置为默认接收者
def post_insert_to_db(cls, subscription: SystemMsgSubscription):
        """
        兼容操作，试图用 `settings.SECURITY_INSECURE_COMMAND_EMAIL_RECEIVER` 的邮件地址
        assets_systemuser_assets找到用户，把用户设置为默认接收者
        """
        from settings.models import Setting
        db_setting = Setting.objects.filter(
            name='SECURITY_INSECURE_COMMAND_EMAIL_RECEIVER'
        ).first()
        if db_setting:
            emails = db_setting.value
        else:
            emails = settings.SECURITY_INSECURE_COMMAND_EMAIL_RECEIVER
        emails = emails.split(',')
        emails = [email.strip().strip('"') for email in emails]

        users = User.objects.filter(email__in=emails)
        if users:
            subscription.users.add(*users)
            subscription.receive_backends = [BACKEND.EMAIL]
            subscription.save()
def post_insert_to_db ( cls , subscription : SystemMsgSubscription ) : from settings . models import Setting db_setting = Setting . objects . filter ( name = 'SECURITY_INSECURE_COMMAND_EMAIL_RECEIVER' ) . first ( ) if db_setting : emails = db_setting . value else : emails = settings . SECURITY_INSECURE_COMMAND_EMAIL_RECEIVER emails = emails . split ( ',' ) emails = [ email . strip ( ) . strip ( '"' ) for email in emails ] users = User . objects . filter ( email__in = emails ) if users : subscription . users . add ( * users ) subscription . receive_backends = [ BACKEND . EMAIL ] subscription . save ( )