mirror of https://github.com/jumpserver/jumpserver
perf: 修改 signal handler
parent
dafc416783
commit
390b8693df
|
@ -11,4 +11,4 @@ class AuditsConfig(AppConfig):
|
||||||
def ready(self):
|
def ready(self):
|
||||||
from . import signal_handlers
|
from . import signal_handlers
|
||||||
if settings.SYSLOG_ENABLE:
|
if settings.SYSLOG_ENABLE:
|
||||||
post_save.connect(signals_handler.on_audits_log_create)
|
post_save.connect(signal_handlers.on_audits_log_create)
|
||||||
|
|
|
@ -8,7 +8,7 @@ class CommonConfig(AppConfig):
|
||||||
name = 'common'
|
name = 'common'
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
from . import signals_handlers
|
from . import signal_handlers
|
||||||
from .signals import django_ready
|
from .signals import django_ready
|
||||||
if 'migrate' in sys.argv or 'compilemessages' in sys.argv:
|
if 'migrate' in sys.argv or 'compilemessages' in sys.argv:
|
||||||
return
|
return
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
`m2m_changed`
|
`m2m_changed`
|
||||||
|
|
||||||
```
|
```
|
||||||
def m2m_signals_handler(action, instance, reverse, model, pk_set, using):
|
def m2m_signal_handler(action, instance, reverse, model, pk_set, using):
|
||||||
pass
|
pass
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -49,7 +49,7 @@ def on_site_message_create(sender, instance, created, **kwargs):
|
||||||
new_site_msg_chan.publish(data)
|
new_site_msg_chan.publish(data)
|
||||||
|
|
||||||
|
|
||||||
@receiver(post_migrate, dispatch_uid='notifications.signals_handler.create_system_messages')
|
@receiver(post_migrate, dispatch_uid='notifications.signal_handlers.create_system_messages')
|
||||||
def create_system_messages(app_config: AppConfig, **kwargs):
|
def create_system_messages(app_config: AppConfig, **kwargs):
|
||||||
try:
|
try:
|
||||||
notifications_module = import_module('.notifications', app_config.module.__package__)
|
notifications_module = import_module('.notifications', app_config.module.__package__)
|
||||||
|
|
Loading…
Reference in New Issue