fix: assessment plan error handling for course field (#23961)
* fix: assessment plan error handling for course field * fix: message rectification * fix(travis): clean-up tests * fix: travis * fix: tests Co-authored-by: pateljannat <jannatpatel@MacBook-Air.local> Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
This commit is contained in:
parent
1c362c81f2
commit
8aeadc743e
@ -124,21 +124,24 @@ class ProgramEnrollment(Document):
|
||||
@frappe.whitelist()
|
||||
@frappe.validate_and_sanitize_search_inputs
|
||||
def get_program_courses(doctype, txt, searchfield, start, page_len, filters):
|
||||
if filters.get('program'):
|
||||
return frappe.db.sql("""select course, course_name from `tabProgram Course`
|
||||
where parent = %(program)s and course like %(txt)s {match_cond}
|
||||
order by
|
||||
if(locate(%(_txt)s, course), locate(%(_txt)s, course), 99999),
|
||||
idx desc,
|
||||
`tabProgram Course`.course asc
|
||||
limit {start}, {page_len}""".format(
|
||||
match_cond=get_match_cond(doctype),
|
||||
start=start,
|
||||
page_len=page_len), {
|
||||
"txt": "%{0}%".format(txt),
|
||||
"_txt": txt.replace('%', ''),
|
||||
"program": filters['program']
|
||||
})
|
||||
if not filters.get('program'):
|
||||
frappe.msgprint(_("Please select a Program first."))
|
||||
return []
|
||||
|
||||
return frappe.db.sql("""select course, course_name from `tabProgram Course`
|
||||
where parent = %(program)s and course like %(txt)s {match_cond}
|
||||
order by
|
||||
if(locate(%(_txt)s, course), locate(%(_txt)s, course), 99999),
|
||||
idx desc,
|
||||
`tabProgram Course`.course asc
|
||||
limit {start}, {page_len}""".format(
|
||||
match_cond=get_match_cond(doctype),
|
||||
start=start,
|
||||
page_len=page_len), {
|
||||
"txt": "%{0}%".format(txt),
|
||||
"_txt": txt.replace('%', ''),
|
||||
"program": filters['program']
|
||||
})
|
||||
|
||||
@frappe.whitelist()
|
||||
@frappe.validate_and_sanitize_search_inputs
|
||||
|
Loading…
x
Reference in New Issue
Block a user