fix: codacy linting issues
diff --git a/erpnext/education/doctype/quiz/quiz.py b/erpnext/education/doctype/quiz/quiz.py
index e35a4ef..6da50a6 100644
--- a/erpnext/education/doctype/quiz/quiz.py
+++ b/erpnext/education/doctype/quiz/quiz.py
@@ -13,7 +13,7 @@
try:
if len(frappe.get_all("Quiz Activity", {'enrollment': enrollment.name, 'quiz': quiz_name})) >= self.max_attempts:
frappe.throw('Maximum attempts reached!')
- except:
+ except Exception as e:
pass
diff --git a/erpnext/public/js/education/lms/call.js b/erpnext/public/js/education/lms/call.js
index 0e6c186..e35acbd 100644
--- a/erpnext/public/js/education/lms/call.js
+++ b/erpnext/public/js/education/lms/call.js
@@ -1,15 +1,15 @@
frappe.ready(() => {
- frappe.provide('lms');
+ frappe.provide('lms');
- lms.call = (method, args) => {
- const method_path = 'erpnext.www.lms.' + method;
- return new Promise((resolve, reject) => {
- return frappe.call({
- method: method_path,
- args,
- })
- .then(r => resolve(r.message))
- .fail(reject)
- });
- }
+ lms.call = (method, args) => {
+ const method_path = 'erpnext.www.lms.' + method;
+ return new Promise((resolve, reject) => {
+ return frappe.call({
+ method: method_path,
+ args,
+ })
+ .then(r => resolve(r.message))
+ .fail(reject);
+ });
+ };
});
\ No newline at end of file
diff --git a/erpnext/public/js/education/lms/lms.js b/erpnext/public/js/education/lms/lms.js
index 45002cc..9ed5cd7 100644
--- a/erpnext/public/js/education/lms/lms.js
+++ b/erpnext/public/js/education/lms/lms.js
@@ -1,26 +1,25 @@
import Vue from 'vue/dist/vue.js';
-import VueRouter from 'vue-router/dist/vue-router.js'
-import moment from 'moment/min/moment.min.js'
+import VueRouter from 'vue-router/dist/vue-router.js';
+import moment from 'moment/min/moment.min.js';
import lmsRoot from "./lmsRoot.vue";
import routes from './routes';
import './call';
-Vue.use(VueRouter)
+Vue.use(VueRouter);
var store = {
enrolledPrograms: [],
enrolledCourses: []
-}
+};
// let profile_page = `<a class="dropdown-item" href="/lms#/Profile" rel="nofollow"> LMS Profile </a>`
// document.querySelector('#website-post-login > ul').innerHTML += profile_page
frappe.ready(() => {
- frappe.provide('lms')
- // frappe.utils.make_event_emitter(lms);
+ frappe.provide('lms');
- lms.moment = moment
+ lms.moment = moment;
lms.store = new Vue({
data: store,
@@ -28,26 +27,24 @@
updateEnrolledPrograms() {
if(this.checkLogin()) {
lms.call("get_program_enrollments").then(data => {
- this.enrolledPrograms = data
+ this.enrolledPrograms = data;
});
- if (lms.debug) console.log('Updated Enrolled Programs', this.enrolledPrograms)
}
},
updateEnrolledCourses() {
if(this.checkLogin()) {
lms.call("get_all_course_enrollments").then(data => {
- this.enrolledCourses = data
+ this.enrolledCourses = data;
})
- if (lms.debug) console.log('Updated Enrolled Courses', this.enrolledCourses)
}
},
checkLogin() {
- return frappe.is_user_logged_in()
+ return frappe.is_user_logged_in();
},
updateState() {
- this.checkLogin()
- this.updateEnrolledPrograms()
- this.updateEnrolledCourses()
+ this.checkLogin();
+ this.updateEnrolledPrograms();
+ this.updateEnrolledCourses();
},
checkProgramEnrollment(programName) {
if(this.checkLogin()){
@@ -80,6 +77,6 @@
});
lms.view.$router.afterEach((to, from) => {
window.scrollTo(0,0)
- })
+ });
lms.debug = true
-})
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/erpnext/public/js/education/lms/routes.js b/erpnext/public/js/education/lms/routes.js
index 657bc7a..3bf0e16 100644
--- a/erpnext/public/js/education/lms/routes.js
+++ b/erpnext/public/js/education/lms/routes.js
@@ -50,7 +50,7 @@
name: 'signup',
path: '/Signup',
beforeEnter(to, from, next) {
- window.location = window.location.origin.toString() + '/login#signup'
+ window.location = window.location.origin.toString() + '/login#signup';
},
component: Home,
props: true
@@ -59,7 +59,7 @@
name: 'login',
path: '/Login',
beforeEnter(to, from, next) {
- window.location = window.location.origin.toString() + '/login#login'
+ window.location = window.location.origin.toString() + '/login#login';
},
component: Home,
props: true
@@ -68,7 +68,7 @@
name: 'logout',
path: '/Logout',
beforeEnter(to, from, next) {
- window.location = window.location.origin.toString() + '/?cmd=web_logout'
+ window.location = window.location.origin.toString() + '/?cmd=web_logout';
},
component: Home,
props: true
@@ -82,9 +82,9 @@
if (!lms.store.checkLogin()) {
next({
name: 'home'
- })
+ });
} else {
- next()
+ next();
}
}
}];