refactor: removed the slug using the course name as part of url

This commit is contained in:
Anand Chitipothu
2021-05-06 13:25:24 +05:30
parent 88457a82ac
commit 5a70687067
9 changed files with 21 additions and 22 deletions

View File

@@ -31,9 +31,9 @@ def redirect_if_not_a_member(course,batch_code):
frappe.local.flags.redirect_location = "/courses/" + course
raise frappe.Redirect
def get_course(slug):
def get_course(name):
try:
return frappe.get_doc("LMS Course", {"slug": slug})
return frappe.get_doc("LMS Course", {"name": name})
except frappe.DoesNotExistError:
return