mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-27 09:04:54 +00:00
added optional user as name
This commit is contained in:
@ -9,6 +9,7 @@ from firebase_admin.messaging import Message, Notification as FirebaseNotificati
|
||||
# django imports
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
# local imports
|
||||
from account.models import UserNotification
|
||||
from account.utils import get_user_full_name
|
||||
from base.constants import GUARDIAN, JUNIOR
|
||||
@ -17,8 +18,6 @@ from junior.models import Junior
|
||||
from notifications.constants import NOTIFICATION_DICT
|
||||
from notifications.models import Notification
|
||||
|
||||
# local imports
|
||||
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
@ -105,7 +104,7 @@ def send_notification(notification_type, from_user_id, from_user_type, to_user_i
|
||||
notification_data.update({'badge': Notification.objects.filter(notification_to=to_user, is_read=False).count()})
|
||||
Notification.objects.create(notification_type=notification_type, notification_from=from_user,
|
||||
notification_to=to_user, data=notification_data)
|
||||
if user_notification_type.push_notification:
|
||||
if user_notification_type and user_notification_type.push_notification:
|
||||
send_push(to_user, push_data)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user