From 624b4fd5b8fcb6f9fbf72017fc090e259c247b26 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 6 Jun 2019 11:30:56 +0530 Subject: [PATCH] refactor: better sql --- erpnext/education/utils.py | 2 +- erpnext/www/lms/content.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/education/utils.py b/erpnext/education/utils.py index ac7294badb..433ef9f829 100644 --- a/erpnext/education/utils.py +++ b/erpnext/education/utils.py @@ -308,7 +308,7 @@ def get_program_completion(program): from `tabcourse topic`, `tabprogram course` where `tabcourse topic`.parent = `tabprogram course`.course - and `tabprogram course`.parent = '{0}'""".format(program.name)) + and `tabprogram course`.parent = %(program)s""", {'program': program}) progress = [] for topic in topics: diff --git a/erpnext/www/lms/content.py b/erpnext/www/lms/content.py index f804cee3bd..3ab7a9f478 100644 --- a/erpnext/www/lms/content.py +++ b/erpnext/www/lms/content.py @@ -63,6 +63,6 @@ def allowed_content_access(program, content, content_type): `tabtopic content` where `tabcourse topic`.parent = `tabprogram course`.course and `tabtopic content`.parent = `tabcourse topic`.topic - and `tabprogram course`.parent = '{0}'""".format(program)) + and `tabprogram course`.parent = %(program)s""", {'program': program}) return (content, content_type) in contents_of_program \ No newline at end of file