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

@@ -7,12 +7,12 @@ def get_context(context):
context.no_cache = 1
try:
course_slug = frappe.form_dict["course"]
course_name = frappe.form_dict["course"]
except KeyError:
frappe.local.flags.redirect_location = "/courses"
raise frappe.Redirect
course = Course.find(course_slug)
course = Course.find(course_name)
if course is None:
frappe.local.flags.redirect_location = "/courses"
raise frappe.Redirect