From dcb85afea4557be2a2f93019c49a516bbdbb6b62 Mon Sep 17 00:00:00 2001 From: Eshwar Date: Wed, 19 Jun 2024 22:34:06 +0530 Subject: [PATCH] Changed it so that only selected student's resumes get downloaded --- CDC_Backend/APIs/adminViews.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CDC_Backend/APIs/adminViews.py b/CDC_Backend/APIs/adminViews.py index dd29042..5d724f5 100644 --- a/CDC_Backend/APIs/adminViews.py +++ b/CDC_Backend/APIs/adminViews.py @@ -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: - resumes[apl.student.roll_no] = STORAGE_DESTINATION_RESUMES + apl.student.id + '/' + apl.resume # Check if the folder name is student id or user id + 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"))