mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
454 B
14 lines
454 B
1 year ago
|
from django.db.models.signals import post_save
|
||
|
from django.dispatch import receiver
|
||
|
|
||
|
from terminal.models import SessionSharing
|
||
|
from terminal.notifications import SessionSharingMessage
|
||
|
|
||
|
|
||
|
@receiver(post_save, sender=SessionSharing)
|
||
|
def on_session_sharing_created(sender, instance: SessionSharing, created, **kwargs):
|
||
|
if not created:
|
||
|
return
|
||
|
for user in instance.users_queryset:
|
||
|
SessionSharingMessage(user, instance).publish_async()
|