fix: lesson editing

This commit is contained in:
Jannat Patel
2024-03-07 10:06:32 +05:30
parent 0ce7c74778
commit 2126b4f657
9 changed files with 87 additions and 28 deletions

View File

@@ -11,7 +11,11 @@ class LMSJobApplication(Document):
self.validate_duplicate()
def after_insert(self):
self.send_email_to_employer()
outgoing_email_account = frappe.get_cached_value(
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
)
if outgoing_email_account:
self.send_email_to_employer()
def validate_duplicate(self):
if frappe.db.exists("LMS Job Application", {"job": self.job, "user": self.user}):

View File

@@ -1757,6 +1757,9 @@ def get_lesson_creation_details(course, chapter, lesson):
"Lesson Reference", {"parent": chapter_name, "idx": lesson}, "lesson"
)
if lesson_name:
lesson_details = frappe.db.get_value("Course Lesson", lesson_name, [""])
return {
"course_title": frappe.db.get_value("LMS Course", course, "title"),
"chapter": frappe.db.get_value(