diff --git a/frontend/src/components/Modals/JobApplicationModal.vue b/frontend/src/components/Modals/JobApplicationModal.vue index 1f7cf0fc..38705288 100644 --- a/frontend/src/components/Modals/JobApplicationModal.vue +++ b/frontend/src/components/Modals/JobApplicationModal.vue @@ -95,7 +95,7 @@ const jobApplication = createResource({ doc: { doctype: 'LMS Job Application', user: user.data?.name, - resume: resume.value?.file_name, + resume: resume.value?.file_url, job: props.job, }, } diff --git a/lms/patches.txt b/lms/patches.txt index 0426a4d9..16c4ef72 100644 --- a/lms/patches.txt +++ b/lms/patches.txt @@ -112,4 +112,5 @@ lms.patches.v2_0.move_batch_instructors_to_evaluators lms.patches.v2_0.enable_programming_exercises_in_sidebar lms.patches.v2_0.count_in_program lms.patches.v2_0.fix_scorm_lesson_reference_idx #02-09-2025 -lms.patches.v2_0.certified_members_to_certifications #05-10-2025 \ No newline at end of file +lms.patches.v2_0.certified_members_to_certifications #05-10-2025 +lms.patches.v2_0.fix_job_application_resume_urls \ No newline at end of file diff --git a/lms/patches/v2_0/fix_job_application_resume_urls.py b/lms/patches/v2_0/fix_job_application_resume_urls.py new file mode 100644 index 00000000..2d9a2291 --- /dev/null +++ b/lms/patches/v2_0/fix_job_application_resume_urls.py @@ -0,0 +1,14 @@ +import frappe + + +def execute(): + applications = frappe.get_all("LMS Job Application", fields=["name", "resume"]) + + for application in applications: + if application.resume and not application.resume.startswith("/files/"): + file_doc = frappe.db.get_value( + "File", {"file_name": application.resume}, ["file_url", "name"], as_dict=True + ) + + if file_doc and file_doc.file_url: + frappe.db.set_value("LMS Job Application", application.name, "resume", file_doc.file_url)