article api changes

This commit is contained in:
abutalib-kiwi
2023-07-21 11:35:58 +05:30
parent 532b56c687
commit 5ee01af825
2 changed files with 23 additions and 27 deletions

View File

@ -51,7 +51,6 @@ def get_basic_detail(notification_type, from_user_id, to_user_id):
def send_notification(notification_type, from_user_id, to_user_id, extra_data):
""" used to send the push for the given notification type """
(notification_data, from_user, to_user) = get_basic_detail(notification_type, from_user_id, to_user_id)
print(notification_data, to_user)
user_notification_type = UserNotification.objects.filter(user=to_user).first()
# data = notification_data.data
data = notification_data
@ -64,7 +63,6 @@ def send_notification(notification_type, from_user_id, to_user_id, extra_data):
def send_push(user, data):
""" used to send push notification to specific user """
# if user.push_notification:
notification_data = data.pop('data', None)
user.fcmdevice_set.filter(active=True).send_message(
Message(notification=FirebaseNotification(data['title'], data['body']), data=notification_data)