merge fixes

This commit is contained in:
karthik murakonda 2022-05-23 22:53:47 +05:30
parent e27087d25a
commit 40ae36381b
1 changed files with 10 additions and 17 deletions

View File

@ -339,26 +339,19 @@ def getstudentapplication(request, id, email, user_type):
student = get_object_or_404(Student, id=data[STUDENT_ID]) student = get_object_or_404(Student, id=data[STUDENT_ID])
student_serializer = StudentSerializer(student) student_serializer = StudentSerializer(student)
# search for the application if there or not # search for the application if there or not
application = PlacementApplication.objects.filter(student=student, application = PlacementApplication.objects.filter(student=student, placement=get_object_or_404(Placement, id=data[OPENING_ID]))
placement=get_object_or_404(Placement, id=data[OPENING_ID])) logger.info("Get Student Application: " + str(application))
if application: if application:
serializer = PlacementApplicationSerializer(application[0]) serializer = PlacementApplicationSerializer(application[0])
return Response( return Response({'action': "Get Student Application", 'found': "true",'application_id': serializer.data["id"] ,
{'action': "Get Student Application", 'found': "true", 'application_id': serializer.data["id"], 'application_additionalInfo': serializer.data[ADDITIONAL_INFO],"available_resumes": student_serializer.data["resume_list"],
'application_additionalInfo': serializer.data[ADDITIONAL_INFO], "available_resumes": student.resumes, "student_name":student.name, "student_branch":student.branch, "student_batch":student.batch, "resume":serializer.data["resume_link"]},
"student_name": student.name, "student_branch": student.branch, "student_batch": student.batch},
status=status.HTTP_200_OK) status=status.HTTP_200_OK)
else: else:
return Response( return Response({'action': "Get Student Application", 'found': "false", "available_resumes": student_serializer.data["resume_list"],
{'action': "Get Student Application", 'found': "false", "available_resumes": student.resumes,
"student_name":student.name, "student_branch":student.branch, "student_batch":student.batch}, "student_name":student.name, "student_branch":student.branch, "student_batch":student.batch},
status=status.HTTP_200_OK) status=status.HTTP_200_OK)
except Http404:
return Response(
{'action': "Get Student Application", 'message': "Not found"},
)
except: except:
logger.warning("Get Student Application: " + str(sys.exc_info())) logger.warning("Get Student Application: " + str(sys.exc_info()))
print(sys.exc_info()) print(sys.exc_info())
return Response({'action': "Get Student Application", 'message': "Student with given roll number not found."}, return Response({'action': "Get Student Application", 'message': "Student with given roll number not found."}, status.HTTP_400_BAD_REQUEST)
status.HTTP_400_BAD_REQUEST)