Updated APIs

This commit is contained in:
Gowtham Sai 2021-12-18 18:12:25 +05:30
parent 21bee24197
commit d4e6292d90
3 changed files with 5 additions and 6 deletions

View File

@ -200,7 +200,7 @@ def submitApplication(request, id, email, user_type):
opening = get_object_or_404(Placement, id=data[OPENING_ID],
allowed_batch__contains=[student.batch],
allowed_branch__contains=[student.branch],
deadline_datetime__gte=datetime.datetime.now().date()
deadline_datetime__gte=datetime.datetime.now()
)
if not opening.offer_accepted or not opening.email_verified:
raise PermissionError("Placement Not Approved")

View File

@ -1,6 +1,5 @@
import json
from datetime import datetime
import datetime
from rest_framework.decorators import api_view
from .serializers import *
@ -72,7 +71,7 @@ def getDashboard(request, id, email, user_type):
placements = Placement.objects.filter(allowed_batch__contains=[studentDetails.batch],
allowed_branch__contains=[studentDetails.branch],
deadline_datetime__gte=datetime.now(),
deadline_datetime__gte=datetime.datetime.now(),
offer_accepted=True, email_verified=True).order_by('deadline_datetime')
placementsdata = PlacementSerializerForStudent(placements, many=True).data
@ -140,7 +139,7 @@ def submitApplication(request, id, email, user_type):
opening = get_object_or_404(Placement, id=data[OPENING_ID],
allowed_batch__contains=[student.batch],
allowed_branch__contains=[student.branch],
deadline_datetime__gte=datetime.now().date()
deadline_datetime__gte=datetime.datetime.now()
)
if not opening.offer_accepted or not opening.email_verified:
raise PermissionError("Placement Not Approved")

View File

@ -154,7 +154,7 @@ def PlacementApplicationConditions(student, placement):
try:
selected_companies = PlacementApplication.objects.filter(student=student, selected=True)
selected_companies_PSU = [i for i in selected_companies if i.placement.tier == 'psu']
PPO = PrePlacementOffer.objects.filter(student=student, accepted=True)
PPO = PrePlacementOffer.objects.filter(student=student, offer_accepted=True)
if len(selected_companies) + len(PPO) >= MAX_OFFERS_PER_STUDENT:
raise PermissionError("Max Applications Reached for the Season")