student_accepet view done

This commit is contained in:
Kovilapu Karthik Karthik 2023-06-14 02:02:05 +05:30
parent fecb2f3593
commit c8398ee3dc
1 changed files with 14 additions and 1 deletions

View File

@ -252,4 +252,17 @@ def getContributorStats(request, id, email, user_type):
@api_view(['POST'])
@isAuthorized(allowed_users=[STUDENT])
def studentAcceptOffer(request, id, email, user_type):
None
try:
company_id = request.data['id']
student_id=request.data['profileInfo']['id']
offer_status = request.data['offerStatus']
placement_application=PlacementApplication.objects.get(placement=company_id,student=student_id)
placement_application.offer_accepted=offer_status
placement_application.save()
return Response({'action': "Accept Offer", 'message': "Updated Offer Status"},
status=status.HTTP_200_OK)
except:
logger.warning("Accept Offer: " + str(sys.exc_info()))
return Response({'action': "Accept Offer", 'message': "Something Went Wrong"},
status=status.HTTP_400_BAD_REQUEST)