Compare commits
3 Commits
642ad8e326
...
90f028651d
Author | SHA1 | Date |
---|---|---|
Jaya Surya P | 90f028651d | |
NitinVangipuram | 3d42366e50 | |
NitinVangipuram | 95d7689a4c |
|
@ -310,13 +310,17 @@ def submitApplication(request, id, email, user_type):
|
||||||
try:
|
try:
|
||||||
data = request.data
|
data = request.data
|
||||||
if OPENING_TYPE in 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:
|
else:
|
||||||
opening_type= "Placement"
|
opening_type= "Placement"
|
||||||
if opening_type == "Internship":
|
if opening_type == "Internship":
|
||||||
opening = get_object_or_404(Internship, pk=data[OPENING_ID])
|
opening = get_object_or_404(Internship, pk=data[OPENING_ID])
|
||||||
else:
|
else:
|
||||||
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
||||||
|
# print(opening);
|
||||||
student = get_object_or_404(Student, pk=data[STUDENT_ID])
|
student = get_object_or_404(Student, pk=data[STUDENT_ID])
|
||||||
# opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
# opening = get_object_or_404(Placement, pk=data[OPENING_ID])
|
||||||
student_user = get_object_or_404(User, id=student.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)
|
row_details.append(apl.selected)
|
||||||
|
|
||||||
for i in opening.additional_info:
|
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)
|
writer.writerow(row_details)
|
||||||
f.close()
|
f.close()
|
||||||
file_path = LINK_TO_APPLICATIONS_CSV + urllib.parse.quote_plus(filename + ".csv")
|
file_path = LINK_TO_APPLICATIONS_CSV + urllib.parse.quote_plus(filename + ".csv")
|
||||||
|
|
Loading…
Reference in New Issue