fix: make resumes private, linked and shared with job owner

This commit is contained in:
Rehan Ansari
2025-11-01 19:08:36 +05:30
parent a5f9adc875
commit 9c38444c4b
2 changed files with 6 additions and 1 deletions

View File

@@ -11,6 +11,10 @@ class LMSJobApplication(Document):
self.validate_duplicate()
def after_insert(self):
job_owner = frappe.get_value("Job Opportunity", self.job, "owner")
if job_owner:
frappe.share.add_docshare("LMS Job Application", self.name, job_owner, read=1)
outgoing_email_account = frappe.get_cached_value(
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
)
@@ -33,7 +37,7 @@ class LMSJobApplication(Document):
resume = frappe.get_doc(
"File",
{
"file_name": self.resume,
"file_url": self.resume,
},
)
frappe.sendmail(