changes in requirement file

This commit is contained in:
jain
2023-07-06 16:08:43 +05:30
parent 2edd8c4e00
commit 3b642fcc5f
7 changed files with 5 additions and 86 deletions

View File

@ -32,7 +32,6 @@ class SignupViewset(viewsets.ModelViewSet):
"""Generate otp"""
otp = generate_otp()
expiry = datetime.today() + timedelta(days=1)
print("expiry===>", expiry, '===>', type(expiry))
UserEmailOtp.objects.create(email=request.data['email'], otp=otp,
user_type=str(request.data['user_type']), expired_at=expiry)
"""Send email to the register user"""
@ -150,35 +149,3 @@ class TopJuniorListAPIView(viewsets.ModelViewSet):
junior_ids_with_total_points})
return custom_response(serializer.data, response_status=status.HTTP_200_OK)
#
# class TopJuniorListAPIView(viewsets.ModelViewSet):
# """Top juniors list"""
# serializer_class = TopJuniorSerializer
# # permission_classes = [IsAuthenticated]
#
# def list(self, request, *args, **kwargs):
# """fetch junior list those complete their task"""
# total_highest_points = list(JuniorTask.objects.filter(task_status=1)
# .values('junior')
# .annotate(total_points=Sum('points'))
# .order_by('-total_points'))
# print("total_highest_points===>",total_highest_points,'===>',type(total_highest_points))
# junior_ids = [item['junior'] for item in total_highest_points]
# print("junior_ids====>", junior_ids)
# juniors = Junior.objects.filter(id__in=junior_ids)
# # a = []
# # for i in junior_ids:
# # juniors = Junior.objects.filter(id=i)
# # a.append(juniors)
# print("juniors====>", juniors)
# # print('a===>',a,'==>',type(a))
# serializer = self.get_serializer(juniors, context={'total_highest_points': total_highest_points}, many=True)
# print("serializer====>",type(serializer.data))
# # Find the junior with the highest points
# # highest_points_junior = max(serializer.data, key=lambda x: x['total_points'])
#
# return custom_response(serializer.data, response_status=status.HTTP_200_OK)
# # serializer = self.get_serializer(total_highest_points, many=True)
# # return custom_response(None, serializer.data,response_status=status.HTTP_200_OK)