Compare commits
12 Commits
48451b9060
...
1b1543d2af
Author | SHA1 | Date |
---|---|---|
Challenger | 1b1543d2af | |
Jaya Surya P | 90f028651d | |
NitinVangipuram | 3d42366e50 | |
NitinVangipuram | 95d7689a4c | |
Jaya Surya P | 642ad8e326 | |
NitinVangipuram | 8aa7246ec9 | |
Jaya Surya P | e184d2af53 | |
NitinVangipuram | e717cbc6e6 | |
NitinVangipuram | e242fff9a7 | |
Jaya Surya P | 4c248be3a5 | |
Jaya Surya P | 7eee78177c | |
NitinVangipuram | ce97fc8342 |
|
@ -310,13 +310,17 @@ def submitApplication(request, id, email, user_type):
|
|||
try:
|
||||
data = request.data
|
||||
if OPENING_TYPE in data:
|
||||
opening_type= data[OPENING_TYPE]
|
||||
if data[OPENING_TYPE] == "Internship":
|
||||
opening_type= "Internship"
|
||||
elif data[OPENING_TYPE] == "placements":
|
||||
opening_type= "Placement"
|
||||
else:
|
||||
opening_type= "Placement"
|
||||
if opening_type == "Internship":
|
||||
opening = get_object_or_404(Internship, pk=data[OPENING_ID])
|
||||
else:
|
||||
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
||||
# print(opening);
|
||||
student = get_object_or_404(Student, pk=data[STUDENT_ID])
|
||||
# opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
||||
student_user = get_object_or_404(User, id=student.id)
|
||||
|
@ -446,8 +450,7 @@ def generateCSV(request, id, email, user_type):
|
|||
row_details.append(apl.selected)
|
||||
|
||||
for i in opening.additional_info:
|
||||
row_details.append(json.loads(apl.additional_info)[i])
|
||||
|
||||
row_details.append(json.loads(apl.additional_info).get(i, ''))
|
||||
writer.writerow(row_details)
|
||||
f.close()
|
||||
file_path = LINK_TO_APPLICATIONS_CSV + urllib.parse.quote_plus(filename + ".csv")
|
||||
|
@ -623,6 +626,17 @@ def getStats(request, id, email, user_type):
|
|||
"psu":0,
|
||||
|
||||
},
|
||||
"EP":{
|
||||
"1":0,
|
||||
"2":0,
|
||||
"3":0,
|
||||
"4":0,
|
||||
"5":0,
|
||||
"6":0,
|
||||
"7":0,
|
||||
"8":0,
|
||||
"psu":0,
|
||||
},
|
||||
"Total": {
|
||||
"1":0,
|
||||
"2":0,
|
||||
|
@ -639,6 +653,7 @@ def getStats(request, id, email, user_type):
|
|||
"CSE": 0,
|
||||
"EE": 0,
|
||||
"MMAE": 0,
|
||||
"EP": 0,
|
||||
"Total": 0,
|
||||
}
|
||||
number_of_students_with_multiple_offers = 0
|
||||
|
@ -646,22 +661,26 @@ def getStats(request, id, email, user_type):
|
|||
"CSE": 0,
|
||||
"EE": 0,
|
||||
"MMAE": 0,
|
||||
"EP": 0,
|
||||
"Total": 0,
|
||||
}
|
||||
max_CTC = {
|
||||
"CSE": 0,
|
||||
"EE": 0,
|
||||
"MMAE": 0
|
||||
"MMAE": 0,
|
||||
"EP": 0,
|
||||
}
|
||||
average_CTC = {
|
||||
"CSE": 0,
|
||||
"EE": 0,
|
||||
"MMAE": 0
|
||||
"MMAE": 0,
|
||||
"EP": 0,
|
||||
}
|
||||
count = {
|
||||
"CSE": 0,
|
||||
"EE": 0,
|
||||
"MMAE": 0
|
||||
"MMAE": 0,
|
||||
"EP": 0,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -116,7 +116,6 @@ def getDashboard(request, id, email, user_type):
|
|||
|
||||
placements = Placement.objects.filter(filters).order_by('deadline_datetime')
|
||||
filtered_placements = placement_eligibility_filters(studentDetails, placements)
|
||||
|
||||
placementsdata = PlacementSerializerForStudent(filtered_placements, many=True).data
|
||||
|
||||
placementApplications = PlacementApplication.objects.filter(student_id=id).order_by('-updated_at')
|
||||
|
@ -129,13 +128,7 @@ def getDashboard(request, id, email, user_type):
|
|||
email_verified=True
|
||||
).order_by('deadline_datetime')
|
||||
else:
|
||||
internships = Internship.objects.filter(
|
||||
allowed_batch__contains=[studentDetails.batch],
|
||||
allowed_branch__contains=[studentDetails.branch],
|
||||
deadline_datetime__gte=datetime.datetime.now(),
|
||||
offer_accepted=True,
|
||||
email_verified=True
|
||||
).order_by('deadline_datetime')
|
||||
internships = Internship.objects.filter(filters).order_by('deadline_datetime')
|
||||
|
||||
|
||||
filtered_internships = internship_eligibility_filters(studentDetails, internships)
|
||||
|
@ -207,11 +200,14 @@ def submitApplication(request, id, email, user_type):
|
|||
if not len(PlacementApplication.objects.filter(
|
||||
student_id=id, placement_id=data[OPENING_ID])):
|
||||
application = PlacementApplication()
|
||||
opening = get_object_or_404(Placement, id=data[OPENING_ID],
|
||||
allowed_batch__contains=[student.batch],
|
||||
application_filters = Q(
|
||||
id=data[OPENING_ID],
|
||||
allowed_branch__contains=[student.branch],
|
||||
deadline_datetime__gte=timezone.now()
|
||||
)
|
||||
if student.degree == "Btech":
|
||||
application_filters &= Q(allowed_batch__contains=[student.batch])
|
||||
opening = get_object_or_404(Placement.objects.filter(application_filters))
|
||||
if not opening.offer_accepted or not opening.email_verified:
|
||||
raise PermissionError("Placement Not Approved")
|
||||
|
||||
|
@ -228,11 +224,14 @@ def submitApplication(request, id, email, user_type):
|
|||
if not len(InternshipApplication.objects.filter(
|
||||
student_id=id, internship_id=data[OPENING_ID])):
|
||||
application = InternshipApplication()
|
||||
opening = get_object_or_404(Internship, id=data[OPENING_ID],
|
||||
allowed_batch__contains=[student.batch],
|
||||
application_filters = Q(
|
||||
id=data[OPENING_ID],
|
||||
allowed_branch__contains=[student.branch],
|
||||
deadline_datetime__gte=timezone.now()
|
||||
)
|
||||
if student.degree == "Btech":
|
||||
application_filters &= Q(allowed_batch__contains=[student.batch])
|
||||
opening = get_object_or_404(Internship.objects.filter(application_filters))
|
||||
if not opening.offer_accepted or not opening.email_verified:
|
||||
raise PermissionError("Internship Not Approved")
|
||||
|
||||
|
|
Loading…
Reference in New Issue