From b409f7a38855b1dd573dd4ef6633755f2e9e3411 Mon Sep 17 00:00:00 2001 From: scmmishra Date: Wed, 7 Nov 2018 22:12:55 +0530 Subject: [PATCH] Minor UI Changes and Fixes --- erpnext/public/js/education/web-academy.js | 2 +- .../components/AcademyCourseCard.vue | 2 +- .../components/AcademyTopSectionButton.vue | 60 ++++++++++++------- .../web-academy/pages/AcademyProgramPage.vue | 1 - erpnext/www/academy.py | 6 ++ 5 files changed, 45 insertions(+), 26 deletions(-) diff --git a/erpnext/public/js/education/web-academy.js b/erpnext/public/js/education/web-academy.js index 3dfd0f2385a..e6b48ecb280 100644 --- a/erpnext/public/js/education/web-academy.js +++ b/erpnext/public/js/education/web-academy.js @@ -16,7 +16,7 @@ const routes = [ ]; var store = { - debug: false, + debug: true, isLogin: false, completedCourses: new Set(), enrolledPrograms: new Set(), diff --git a/erpnext/public/js/education/web-academy/components/AcademyCourseCard.vue b/erpnext/public/js/education/web-academy/components/AcademyCourseCard.vue index 426b9877cb6..9c474739692 100644 --- a/erpnext/public/js/education/web-academy/components/AcademyCourseCard.vue +++ b/erpnext/public/js/education/web-academy/components/AcademyCourseCard.vue @@ -12,7 +12,7 @@
- +
diff --git a/erpnext/public/js/education/web-academy/components/AcademyTopSectionButton.vue b/erpnext/public/js/education/web-academy/components/AcademyTopSectionButton.vue index e1df97e79e3..8cc3a7b5fa2 100644 --- a/erpnext/public/js/education/web-academy/components/AcademyTopSectionButton.vue +++ b/erpnext/public/js/education/web-academy/components/AcademyTopSectionButton.vue @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/erpnext/public/js/education/web-academy/pages/AcademyProgramPage.vue b/erpnext/public/js/education/web-academy/pages/AcademyProgramPage.vue index ef4545936ed..030c3ed34e3 100644 --- a/erpnext/public/js/education/web-academy/pages/AcademyProgramPage.vue +++ b/erpnext/public/js/education/web-academy/pages/AcademyProgramPage.vue @@ -30,7 +30,6 @@ export default { } }, beforeMount(){ - console.log("Before Mount") if(this.$root.$data.isLogin) this.$root.$data.updateCompletedCourses() }, mounted() { diff --git a/erpnext/www/academy.py b/erpnext/www/academy.py index d68dee43c53..4aec61488ad 100644 --- a/erpnext/www/academy.py +++ b/erpnext/www/academy.py @@ -110,6 +110,8 @@ def evaluate_quiz(enrollment, quiz_response, quiz_name): @frappe.whitelist() def get_completed_courses(email=frappe.session.user): + if get_student_id(email) == None: + return None try: student = frappe.get_doc("Student", get_student_id(email)) return student.get_completed_courses() @@ -161,6 +163,8 @@ def get_student_id(email=None): @frappe.whitelist() def get_program_enrollments(email=frappe.session.user): + if get_student_id(email) == None: + return None try: student = frappe.get_doc("Student", get_student_id(email)) return student.get_program_enrollments() @@ -169,6 +173,8 @@ def get_program_enrollments(email=frappe.session.user): @frappe.whitelist() def get_course_enrollments(email=frappe.session.user): + if get_student_id(email) == None: + return None try: student = frappe.get_doc("Student", get_student_id(email)) return student.get_course_enrollments()