mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-10 15:17:44 +00:00
feedback changes and added mark all read
This commit is contained in:
@ -44,7 +44,7 @@ ERROR_CODE = {
|
|||||||
"2018": "Attached File not found",
|
"2018": "Attached File not found",
|
||||||
"2019": "Invalid Referral code",
|
"2019": "Invalid Referral code",
|
||||||
"2020": "Enter valid mobile number",
|
"2020": "Enter valid mobile number",
|
||||||
"2021": "Already register",
|
"2021": "User registered",
|
||||||
"2022": "Invalid Guardian code",
|
"2022": "Invalid Guardian code",
|
||||||
"2023": "Invalid user",
|
"2023": "Invalid user",
|
||||||
# email not verified
|
# email not verified
|
||||||
|
@ -149,7 +149,7 @@ class TaskListAPIView(viewsets.ModelViewSet):
|
|||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
queryset = JuniorTask.objects.filter(guardian__user=self.request.user
|
queryset = JuniorTask.objects.filter(guardian__user=self.request.user
|
||||||
).select_related('junior', 'junior__auth'
|
).select_related('junior', 'junior__auth'
|
||||||
).order_by('due_date', 'created_at')
|
).order_by('-created_at')
|
||||||
|
|
||||||
queryset = self.filter_queryset(queryset)
|
queryset = self.filter_queryset(queryset)
|
||||||
return queryset
|
return queryset
|
||||||
|
@ -108,7 +108,7 @@ class CreateJuniorSerializer(serializers.ModelSerializer):
|
|||||||
if guardian_data:
|
if guardian_data:
|
||||||
JuniorGuardianRelationship.objects.get_or_create(guardian=guardian_data, junior=junior)
|
JuniorGuardianRelationship.objects.get_or_create(guardian=guardian_data, junior=junior)
|
||||||
send_notification.delay(ASSOCIATE_REQUEST, junior.auth_id, JUNIOR, guardian_data.user_id, {})
|
send_notification.delay(ASSOCIATE_REQUEST, junior.auth_id, JUNIOR, guardian_data.user_id, {})
|
||||||
junior_approval_mail.delay(user.email, user.first_name)
|
# junior_approval_mail.delay(user.email, user.first_name) removed as per changes
|
||||||
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)
|
||||||
@ -466,7 +466,7 @@ class AddGuardianSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
"""Notification email"""
|
"""Notification email"""
|
||||||
junior_notification_email(email, full_name, email, password)
|
junior_notification_email(email, full_name, email, password)
|
||||||
junior_approval_mail.delay(email, full_name)
|
# junior_approval_mail.delay(email, full_name) removed as per changes
|
||||||
send_notification.delay(ASSOCIATE_REQUEST, junior_data.auth_id, JUNIOR, guardian_data.user_id, {})
|
send_notification.delay(ASSOCIATE_REQUEST, junior_data.auth_id, JUNIOR, guardian_data.user_id, {})
|
||||||
return guardian_data
|
return guardian_data
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ class JuniorTaskListAPIView(viewsets.ModelViewSet):
|
|||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
queryset = JuniorTask.objects.filter(junior__auth=self.request.user
|
queryset = JuniorTask.objects.filter(junior__auth=self.request.user
|
||||||
).select_related('junior', 'junior__auth'
|
).select_related('junior', 'junior__auth'
|
||||||
).order_by('due_date', 'created_at')
|
).order_by('-created_at')
|
||||||
|
|
||||||
queryset = self.filter_queryset(queryset)
|
queryset = self.filter_queryset(queryset)
|
||||||
return queryset
|
return queryset
|
||||||
|
@ -68,5 +68,8 @@ class NotificationViewSet(viewsets.GenericViewSet):
|
|||||||
"""
|
"""
|
||||||
notification list
|
notification list
|
||||||
"""
|
"""
|
||||||
|
if request.query_params.get('all'):
|
||||||
|
Notification.objects.filter(notification_to_id=request.auth.payload['user_id']).update(is_read=True)
|
||||||
|
elif request.data.get('id'):
|
||||||
Notification.objects.filter(id__in=request.data.get('id')).update(is_read=True)
|
Notification.objects.filter(id__in=request.data.get('id')).update(is_read=True)
|
||||||
return custom_response(SUCCESS_CODE['3039'], response_status=status.HTTP_200_OK)
|
return custom_response(SUCCESS_CODE['3039'], response_status=status.HTTP_200_OK)
|
||||||
|
Reference in New Issue
Block a user