changes in notification method

This commit is contained in:
abutalib-kiwi
2023-08-16 16:40:34 +05:30
parent e73113fcca
commit 3017b0ece0
9 changed files with 72 additions and 37 deletions

View File

@ -13,7 +13,7 @@ from base.messages import SUCCESS_CODE, ERROR_CODE
from notifications.constants import TEST_NOTIFICATION
# Import serializer
from notifications.serializers import RegisterDevice, NotificationListSerializer, ReadNotificationSerializer
from notifications.utils import send_notification
from notifications.utils import send_notification, send_notification_to_guardian, send_notification_to_junior
# Import model
from notifications.models import Notification
@ -56,8 +56,10 @@ class NotificationViewSet(viewsets.GenericViewSet):
to send test notification
:return:
"""
send_notification(TEST_NOTIFICATION, None, request.auth.payload['user_id'],
{'task_id': None})
send_notification_to_guardian(TEST_NOTIFICATION, None, request.auth.payload['user_id'],
{'task_id': None})
send_notification_to_junior(TEST_NOTIFICATION, request.auth.payload['user_id'], None,
{'task_id': None})
return custom_response(SUCCESS_CODE["3000"])
@action(methods=['get'], detail=False, url_path='list', url_name='list',