Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 685353d

Browse files
Added handling of no course ref in lms award badge
1 parent 43fa7cd commit 685353d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/users/lms/award-badge.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ function awardLMSBadge (args, cb) {
1818
var LMSPassword = process.env.LMSPassword;
1919
var APIUrl = process.env.LMS_API_URL;
2020

21+
if (!certif.courseReferenceCode) {
22+
return cb(null, {ok: true, why: 'No badge for course'});
23+
}
24+
2125
function checkTestStatus (waterfallCb) {
2226
if (certif.header.webHookType !== 'course_completion') {
2327
return cb(null, {ok: false, why: 'Unhandled webhook'});

0 commit comments

Comments
 (0)