refactor: better sql
This commit is contained in:
parent
f121b51951
commit
624b4fd5b8
@ -308,7 +308,7 @@ def get_program_completion(program):
|
|||||||
from `tabcourse topic`,
|
from `tabcourse topic`,
|
||||||
`tabprogram course`
|
`tabprogram course`
|
||||||
where `tabcourse topic`.parent = `tabprogram course`.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 = []
|
progress = []
|
||||||
for topic in topics:
|
for topic in topics:
|
||||||
|
|||||||
@ -63,6 +63,6 @@ def allowed_content_access(program, content, content_type):
|
|||||||
`tabtopic content`
|
`tabtopic content`
|
||||||
where `tabcourse topic`.parent = `tabprogram course`.course
|
where `tabcourse topic`.parent = `tabprogram course`.course
|
||||||
and `tabtopic content`.parent = `tabcourse topic`.topic
|
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
|
return (content, content_type) in contents_of_program
|
||||||
Loading…
x
Reference in New Issue
Block a user