fix: use file_url instead of file_name
This commit is contained in:
@@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -113,3 +113,4 @@ 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
|
||||
lms.patches.v2_0.fix_job_application_resume_urls
|
||||
14
lms/patches/v2_0/fix_job_application_resume_urls.py
Normal file
14
lms/patches/v2_0/fix_job_application_resume_urls.py
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user