fix: fixed the error in saving a new course

This commit is contained in:
Anand Chitipothu
2021-05-07 05:18:06 +05:30
parent bc11730697
commit c764aa6c20

View File

@@ -28,8 +28,8 @@ class LMSCourse(Document):
def generate_slug(self, title):
result = frappe.get_all(
'LMS Course',
fields=['slug'])
slugs = set([row['slug'] for row in result])
fields=['name'])
slugs = set([row['name'] for row in result])
return slugify(title, used_slugs=slugs)
def __repr__(self):