fix: show only courses with evaluator for batch evaluation

This commit is contained in:
Jannat Patel
2024-11-08 14:52:10 +05:30
parent 3ea52a4e41
commit 2d5c76e106
2 changed files with 8 additions and 6 deletions

View File

@@ -154,10 +154,12 @@ function submitEvaluation(close) {
const getCourses = () => {
let courses = []
for (const course of props.courses) {
courses.push({
label: course.title,
value: course.course,
})
if (course.evaluator) {
courses.push({
label: course.title,
value: course.course,
})
}
}
return courses
}

View File

@@ -1103,7 +1103,7 @@ def get_categorized_courses(courses):
categories = [live, enrolled, created]
for category in categories:
category.sort(key=lambda x: x.enrollments, reverse=True)
category.sort(key=lambda x: cint(x.enrollments), reverse=True)
live.sort(key=lambda x: x.featured, reverse=True)
@@ -1265,7 +1265,7 @@ def get_batch_details(batch):
batch_details.instructors = get_instructors(batch)
batch_details.courses = frappe.get_all(
"Batch Course", filters={"parent": batch}, fields=["course", "title"]
"Batch Course", filters={"parent": batch}, fields=["course", "title", "evaluator"]
)
batch_details.students = frappe.get_all(
"Batch Student", {"parent": batch}, pluck="student"