minor changes

This commit is contained in:
abutalib-kiwi
2023-08-22 16:01:08 +05:30
parent 95dad86b12
commit d573d56a35
4 changed files with 10 additions and 3 deletions

Binary file not shown.

View File

@ -98,7 +98,7 @@ class CreateJuniorSerializer(serializers.ModelSerializer):
JuniorGuardianRelationship.objects.get_or_create(guardian=guardian_data, junior=junior) JuniorGuardianRelationship.objects.get_or_create(guardian=guardian_data, junior=junior)
junior.guardian_code_status = str(NUMBER['three']) junior.guardian_code_status = str(NUMBER['three'])
junior_approval_mail(user.email, user.first_name) junior_approval_mail(user.email, user.first_name)
send_notification_to_guardian.delay(APPROVED_JUNIOR, junior.auth.id, guardian_data.user.id, {}) send_notification_to_guardian.delay(ASSOCIATE_REQUEST, junior.auth.id, guardian_data.user.id, {})
junior.dob = validated_data.get('dob', junior.dob) junior.dob = validated_data.get('dob', junior.dob)
junior.passcode = validated_data.get('passcode', junior.passcode) junior.passcode = validated_data.get('passcode', junior.passcode)
junior.country_name = validated_data.get('country_name', junior.country_name) junior.country_name = validated_data.get('country_name', junior.country_name)

View File

@ -11,4 +11,3 @@ class NotificationAdmin(admin.ModelAdmin):
"""Notification Admin""" """Notification Admin"""
list_display = ['id', 'notification_type', 'notification_to', 'data', 'is_read'] list_display = ['id', 'notification_type', 'notification_to', 'data', 'is_read']
list_filter = ['notification_type'] list_filter = ['notification_type']

View File

@ -32,15 +32,17 @@ NOTIFICATION_DICT = {
"title": "Associate request!", "title": "Associate request!",
"body": "You have request from {from_user} to associate with you." "body": "You have request from {from_user} to associate with you."
}, },
# Juniors will receive Notifications for every Points earned by referrals
REFERRAL_POINTS: { REFERRAL_POINTS: {
"title": "Earn Referral points!", "title": "Earn Referral points!",
"body": "You earn 5 points for referral." "body": "You earn 5 points for referral."
}, },
# notification once any custodian adds junior in their account # Juniors will receive notification once any custodians add them in their account
SKIPPED_PROFILE_SETUP: { SKIPPED_PROFILE_SETUP: {
"title": "Profile already setup!", "title": "Profile already setup!",
"body": "Your guardian has already setup your profile." "body": "Your guardian has already setup your profile."
}, },
# Juniors will receive Notification for every Task Assign by Custodians
TASK_ASSIGNED: { TASK_ASSIGNED: {
"title": "New task assigned!", "title": "New task assigned!",
"body": "{from_user} has assigned you a new task." "body": "{from_user} has assigned you a new task."
@ -49,10 +51,12 @@ NOTIFICATION_DICT = {
"title": "Task submitted!", "title": "Task submitted!",
"body": "Your task has been submitted for approval." "body": "Your task has been submitted for approval."
}, },
# Guardian will receive notification as soon as junior send task for approval
TASK_ACTION: { TASK_ACTION: {
"title": "Task completion approval!", "title": "Task completion approval!",
"body": "You have request from {from_user} for task completion." "body": "You have request from {from_user} for task completion."
}, },
# Juniors will receive notification as soon as their task is approved or reject by custodians
TASK_REJECTED: { TASK_REJECTED: {
"title": "Task completion rejected!", "title": "Task completion rejected!",
"body": "Your task completion request has been rejected by {from_user}." "body": "Your task completion request has been rejected by {from_user}."
@ -61,14 +65,18 @@ NOTIFICATION_DICT = {
"title": "Task completion approved!", "title": "Task completion approved!",
"body": "Your task completion request has been approved by {from_user}." "body": "Your task completion request has been approved by {from_user}."
}, },
# Juniors will receive Notifications for every Points earned either by Task completion
# Juniors will receive notification as soon as their task is approved or reject by custodians
TASK_POINTS: { TASK_POINTS: {
"title": "Earned Task points!", "title": "Earned Task points!",
"body": "You earn 5 points for task." "body": "You earn 5 points for task."
}, },
# Juniors will receive Notification related to Leaderboard progress
LEADERBOARD_RANKING: { LEADERBOARD_RANKING: {
"title": "Leader board rank!", "title": "Leader board rank!",
"body": "Your rank is ." "body": "Your rank is ."
}, },
# Juniors will receive notification as soon as their custodians remove them from account
REMOVE_JUNIOR: { REMOVE_JUNIOR: {
"title": "Disassociate by guardian!", "title": "Disassociate by guardian!",
"body": "Your guardian has disassociated you." "body": "Your guardian has disassociated you."