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_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},
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},
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 Http404:
return Response(
{'action': "Get Student Application", 'message': "Not found"},
)
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)