fix: fixed joining date bug on lms profile
diff --git a/erpnext/public/js/education/lms/components/ProfileInfo.vue b/erpnext/public/js/education/lms/components/ProfileInfo.vue
index ae1a04f..6f3e8f1 100644
--- a/erpnext/public/js/education/lms/components/ProfileInfo.vue
+++ b/erpnext/public/js/education/lms/components/ProfileInfo.vue
@@ -10,7 +10,7 @@
<div class="col-md-3 col-sm-4 pr-0 text-muted">Email:</div>
<div class="col-md-9 col-sm-8">{{ email }}</div>
</li>
- <li class="row">
+ <li v-if="joiningDate" class="row">
<div class="col-md-3 col-sm-4 pr-0 text-muted">Date of Joining:</div>
<div class="col-md-9 col-sm-8">{{ joiningDate }}</div>
</li>
@@ -43,11 +43,15 @@
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 f8e7340..6c3c4c2 100644
--- a/erpnext/www/lms.py
+++ b/erpnext/www/lms.py
@@ -255,8 +255,12 @@
@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):