fix: api and orm

This commit is contained in:
pateljannat
2021-06-02 20:19:36 +05:30
parent 4fd7af053b
commit 671b4a0650
5 changed files with 30 additions and 18 deletions

View File

@@ -28,7 +28,7 @@
{{ widgets.BatchTabs(course=course, batch=batch) }}
<div class="lesson-page">
<h2 class="title {% if course.is_mentor(frappe.session.user) %} is_mentor {% endif %}" data-name="{{ lesson.name }}">{{ lesson.title }}</h2>
<h2 class="title {% if course.is_mentor(frappe.session.user) %} is_mentor {% endif %}" data-name="{{ lesson.name }}" data-batch="{{ batch.name }}">{{ lesson.title }}</h2>
{% for s in lesson.get_sections() %}
<div class="section section-{{ s.type }}">

View File

@@ -1,10 +1,10 @@
frappe.ready(() => {
console.log($(".title").hasClass("is_mentor"))
if (!$(".title").hasClass("is_mentor")) {
frappe.call({
method: "community.lms.doctype.lesson.lesson.save_progress",
args: {
lesson: $(".title").attr("data-name")
lesson: $(".title").attr("data-name"),
batch: $(".title").attr("data-batch")
}
})
}