mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 16:44:54 +00:00
added notification for getting points after reading article
This commit is contained in:
@ -77,6 +77,7 @@ def get_notification_data(notification_type, from_user_id, from_user_type, to_us
|
||||
push_data = NOTIFICATION_DICT[notification_type].copy()
|
||||
notification_data = push_data.copy()
|
||||
task_name = None
|
||||
points = extra_data.get('points', None)
|
||||
if 'task_id' in extra_data:
|
||||
task = JuniorTask.objects.filter(id=extra_data.get('task_id')).first()
|
||||
task_name = task.task_name
|
||||
@ -85,8 +86,9 @@ def get_notification_data(notification_type, from_user_id, from_user_type, to_us
|
||||
|
||||
from_user_name, from_user_image, from_user = get_from_user_details(from_user_id, from_user_type)
|
||||
|
||||
push_data['body'] = push_data['body'].format(from_user=from_user_name, task_name=task_name)
|
||||
notification_data['body'] = notification_data['body'].format(from_user=from_user_name, task_name=task_name)
|
||||
push_data['body'] = push_data['body'].format(from_user=from_user_name, task_name=task_name, points=points)
|
||||
notification_data['body'] = notification_data['body'].format(from_user=from_user_name,
|
||||
task_name=task_name, points=points)
|
||||
notification_data['from_user'] = from_user_name
|
||||
notification_data['from_user_image'] = from_user_image
|
||||
|
||||
|
||||
Reference in New Issue
Block a user