From cf8549bb28681555bc5f8c4f6acfdf56fbb287e4 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Tue, 27 Sep 2022 18:21:57 +0530 Subject: [PATCH] fix: removed unused functions --- lms/www/dashboard/index.py | 55 -------------------------------------- 1 file changed, 55 deletions(-) diff --git a/lms/www/dashboard/index.py b/lms/www/dashboard/index.py index b15c0a9e..df19be65 100644 --- a/lms/www/dashboard/index.py +++ b/lms/www/dashboard/index.py @@ -22,58 +22,3 @@ def get_notifications(): notification.url = "/courses/{0}/learn/{1}".format(course, get_lesson_index(notification.document_name)) return notifications - - -def get_notifications_old(): - notifications = [] - - notifications += get_notifications_from_lessons_created() - - notifications += get_notifications_from_topics_created() - - if len(notifications): - notifications = sorted(notifications, key=lambda t: datetime.strptime(frappe.utils.format_datetime(t.creation, "dd-mm-yyyy HH:mm:ss"),"%d/%m/%Y %H:%M:%S")) - return notifications - - -def get_notifications_from_lessons_created(): - - lessons = frappe.get_all("Course Lesson", { - "owner": frappe.session.user - }, ["name"]) - - for lesson in lessons: - topics = frappe.get_all("Discussion Topic", { - "reference_doctype": "Course Lesson", - "reference_docname": lesson.name - }, ["name"]) - - return get_notifications_from_replies(topics) - - -def get_notifications_from_topics_created(): - - topics = frappe.get_all("Discussion Topic", { - "owner": frappe.session.user - }, ["name"]) - - return get_notifications_from_replies(topics) - - - -def get_notifications_from_replies(topics): - notifications = [] - - for topic in topics: - replies = frappe.get_all("Discussion Reply", { - "topic": topic.name - }, ["reply", "owner", "creation"]) - - for reply in replies: - notification = frappe._dict() - notification["message"] = reply.reply - notification["user"] = reply.owner - notification["creation"] = reply.creation - notifications.append(notification) - - return notifications