mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-04 17:01:09 +00:00
perf: 优化通知 (#6798)
* perf: 优化通知 * perf: 优化危险命令提示 * fix: i18n * fix: i18n Co-authored-by: ibuler <ibuler@qq.com> Co-authored-by: Michael Bai <baijiangjie@gmail.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
from typing import Iterable
|
||||
import traceback
|
||||
from itertools import chain
|
||||
from collections import defaultdict
|
||||
|
||||
from celery import shared_task
|
||||
|
||||
@@ -90,6 +89,11 @@ class Message(metaclass=MessageType):
|
||||
except:
|
||||
traceback.print_exc()
|
||||
|
||||
def send_test_msg(self):
|
||||
from users.models import User
|
||||
users = User.objects.filter(username='admin')
|
||||
self.send_msg(users, [])
|
||||
|
||||
def get_common_msg(self) -> dict:
|
||||
raise NotImplementedError
|
||||
|
||||
@@ -115,7 +119,7 @@ class Message(metaclass=MessageType):
|
||||
return self.common_msg
|
||||
|
||||
def get_sms_msg(self) -> dict:
|
||||
raise NotImplementedError
|
||||
return self.common_msg
|
||||
# --------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -136,6 +140,7 @@ class SystemMessage(Message):
|
||||
|
||||
self.send_msg(users, receive_backends)
|
||||
|
||||
|
||||
@classmethod
|
||||
def post_insert_to_db(cls, subscription: SystemMsgSubscription):
|
||||
pass
|
||||
|
Reference in New Issue
Block a user