Compare commits
No commits in common. "e184d2af53f5a4f5d04de8fa498da56af62d72af" and "4c248be3a53d76d6092efc2c1d59257e043892e0" have entirely different histories.
e184d2af53
...
4c248be3a5
|
@ -116,6 +116,7 @@ def getDashboard(request, id, email, user_type):
|
||||||
|
|
||||||
placements = Placement.objects.filter(filters).order_by('deadline_datetime')
|
placements = Placement.objects.filter(filters).order_by('deadline_datetime')
|
||||||
filtered_placements = placement_eligibility_filters(studentDetails, placements)
|
filtered_placements = placement_eligibility_filters(studentDetails, placements)
|
||||||
|
|
||||||
placementsdata = PlacementSerializerForStudent(filtered_placements, many=True).data
|
placementsdata = PlacementSerializerForStudent(filtered_placements, many=True).data
|
||||||
|
|
||||||
placementApplications = PlacementApplication.objects.filter(student_id=id).order_by('-updated_at')
|
placementApplications = PlacementApplication.objects.filter(student_id=id).order_by('-updated_at')
|
||||||
|
@ -206,13 +207,10 @@ def submitApplication(request, id, email, user_type):
|
||||||
if not len(PlacementApplication.objects.filter(
|
if not len(PlacementApplication.objects.filter(
|
||||||
student_id=id, placement_id=data[OPENING_ID])):
|
student_id=id, placement_id=data[OPENING_ID])):
|
||||||
application = PlacementApplication()
|
application = PlacementApplication()
|
||||||
opening = get_object_or_404(
|
opening = get_object_or_404(Placement, id=data[OPENING_ID],
|
||||||
Placement,
|
allowed_batch__contains=[student.batch],
|
||||||
id=data[OPENING_ID],
|
|
||||||
allowed_branch__contains=[student.branch],
|
allowed_branch__contains=[student.branch],
|
||||||
deadline_datetime__gte=timezone.now(),
|
deadline_datetime__gte=timezone.now()
|
||||||
# Only check allowed_batch if the degree is Btech
|
|
||||||
**({"allowed_batch__contains": [student.batch]} if student.degree == "Btech" else {})
|
|
||||||
)
|
)
|
||||||
if not opening.offer_accepted or not opening.email_verified:
|
if not opening.offer_accepted or not opening.email_verified:
|
||||||
raise PermissionError("Placement Not Approved")
|
raise PermissionError("Placement Not Approved")
|
||||||
|
@ -231,10 +229,9 @@ def submitApplication(request, id, email, user_type):
|
||||||
student_id=id, internship_id=data[OPENING_ID])):
|
student_id=id, internship_id=data[OPENING_ID])):
|
||||||
application = InternshipApplication()
|
application = InternshipApplication()
|
||||||
opening = get_object_or_404(Internship, id=data[OPENING_ID],
|
opening = get_object_or_404(Internship, id=data[OPENING_ID],
|
||||||
|
allowed_batch__contains=[student.batch],
|
||||||
allowed_branch__contains=[student.branch],
|
allowed_branch__contains=[student.branch],
|
||||||
deadline_datetime__gte=timezone.now()
|
deadline_datetime__gte=timezone.now()
|
||||||
# Only check allowed_batch if the degree is Btech
|
|
||||||
**({"allowed_batch__contains": [student.batch]} if student.degree == "Btech" else {})
|
|
||||||
)
|
)
|
||||||
if not opening.offer_accepted or not opening.email_verified:
|
if not opening.offer_accepted or not opening.email_verified:
|
||||||
raise PermissionError("Internship Not Approved")
|
raise PermissionError("Internship Not Approved")
|
||||||
|
|
Loading…
Reference in New Issue