Changed it so that only selected student's resumes get downloaded
This commit is contained in:
parent
0be1a6c56e
commit
dcb85afea4
|
@ -480,9 +480,9 @@ def downloadResume(request, id, email, user_type):
|
|||
os.makedirs(STORAGE_DESTINATION_RESUME_ZIP, exist_ok=True)
|
||||
resumes = {}
|
||||
for apl in applications:
|
||||
if apl.selected:
|
||||
resumes[apl.student.roll_no] = STORAGE_DESTINATION_RESUMES + apl.student.id + '/' + apl.resume # Check if the folder name is student id or user id
|
||||
|
||||
print("Resumes: ", resumes)
|
||||
with zipfile.ZipFile(STORAGE_DESTINATION_RESUME_ZIP + zip_filename, 'w', zipfile.ZIP_DEFLATED) as zip_file:
|
||||
for student_roll_no, resume_path in resumes.items():
|
||||
zip_file.write(resume_path, os.path.basename(str(student_roll_no) + ".pdf"))
|
||||
|
|
Loading…
Reference in New Issue