From 40ae36381b9606a41cd3942c52c55b0f7f27fe7b Mon Sep 17 00:00:00 2001 From: karthik murakonda Date: Mon, 23 May 2022 22:53:47 +0530 Subject: [PATCH] merge fixes --- CDC_Backend/APIs/adminViews.py | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/CDC_Backend/APIs/adminViews.py b/CDC_Backend/APIs/adminViews.py index 9086060..98607af 100644 --- a/CDC_Backend/APIs/adminViews.py +++ b/CDC_Backend/APIs/adminViews.py @@ -339,26 +339,19 @@ def getstudentapplication(request, id, email, user_type): student = get_object_or_404(Student, id=data[STUDENT_ID]) student_serializer = StudentSerializer(student) # search for the application if there or not - application = PlacementApplication.objects.filter(student=student, - placement=get_object_or_404(Placement, id=data[OPENING_ID])) + application = PlacementApplication.objects.filter(student=student, placement=get_object_or_404(Placement, id=data[OPENING_ID])) + logger.info("Get Student Application: " + str(application)) if application: serializer = PlacementApplicationSerializer(application[0]) - return Response( - {'action': "Get Student Application", 'found': "true", 'application_id': serializer.data["id"], - 'application_additionalInfo': serializer.data[ADDITIONAL_INFO], "available_resumes": student.resumes, - "student_name": student.name, "student_branch": student.branch, "student_batch": student.batch}, - status=status.HTTP_200_OK) + return Response({'action': "Get Student Application", 'found': "true",'application_id': serializer.data["id"] , + 'application_additionalInfo': serializer.data[ADDITIONAL_INFO],"available_resumes": student_serializer.data["resume_list"], + "student_name":student.name, "student_branch":student.branch, "student_batch":student.batch, "resume":serializer.data["resume_link"]}, + status=status.HTTP_200_OK) else: - return Response( - {'action': "Get Student Application", 'found': "false", "available_resumes": student.resumes, - "student_name": student.name, "student_branch": student.branch, "student_batch": student.batch}, - status=status.HTTP_200_OK) - except Http404: - return Response( - {'action': "Get Student Application", 'message': "Not found"}, - ) + return Response({'action': "Get Student Application", 'found': "false", "available_resumes": student_serializer.data["resume_list"], + "student_name":student.name, "student_branch":student.branch, "student_batch":student.batch}, + status=status.HTTP_200_OK) except: logger.warning("Get Student Application: " + str(sys.exc_info())) print(sys.exc_info()) - return Response({'action': "Get Student Application", 'message': "Student with given roll number not found."}, - status.HTTP_400_BAD_REQUEST) + return Response({'action': "Get Student Application", 'message': "Student with given roll number not found."}, status.HTTP_400_BAD_REQUEST)