From 9b7ac3e7d2fa91dddc60a38c14998d2e6599089b Mon Sep 17 00:00:00 2001 From: scmmishra Date: Thu, 28 Mar 2019 14:47:22 +0530 Subject: [PATCH] fix: fixed joining date bug on lms profile --- .../public/js/education/lms/components/ProfileInfo.vue | 10 +++++++--- erpnext/www/lms.py | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/erpnext/public/js/education/lms/components/ProfileInfo.vue b/erpnext/public/js/education/lms/components/ProfileInfo.vue index ae1a04f7116..6f3e8f12664 100644 --- a/erpnext/public/js/education/lms/components/ProfileInfo.vue +++ b/erpnext/public/js/education/lms/components/ProfileInfo.vue @@ -10,7 +10,7 @@
Email:
{{ email }}
-
  • +
  • Date of Joining:
    {{ joiningDate }}
  • @@ -43,11 +43,15 @@ export default { fullName: frappe.full_name, abbr: frappe.get_abbr(frappe.get_cookie("full_name")), email: frappe.session.user, - joiningDate: 'fetching...' + joiningDate: '' } }, mounted(){ - this.getJoiningDate().then(data => this.joiningDate = lms.moment(String(data)).format('D MMMM YYYY')) + this.getJoiningDate().then(data => { + if(data) { + this.joiningDate = lms.moment(String(data)).format('D MMMM YYYY') + } + }) }, computed: { avatarStyle() { diff --git a/erpnext/www/lms.py b/erpnext/www/lms.py index f8e7340eb5f..6c3c4c25cdf 100644 --- a/erpnext/www/lms.py +++ b/erpnext/www/lms.py @@ -255,8 +255,12 @@ def get_program_progress(program_name): @frappe.whitelist() def get_joining_date(): - student = frappe.get_doc("Student", utils.get_current_student()) - return student.joining_date + current_student = utils.get_current_student() + if(current_student): + student = frappe.get_doc("Student", current_student) + return student.joining_date + else: + return None @frappe.whitelist() def get_quiz_progress(program_name):