From 1695a760efe9983fe155b629ae38f4f548de7e01 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Wed, 7 Oct 2015 16:30:51 -0700 Subject: [PATCH] Fix check for _id as well as id during certification --- server/boot/certificate.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/boot/certificate.js b/server/boot/certificate.js index c35e97127b..2e106b5d8c 100644 --- a/server/boot/certificate.js +++ b/server/boot/certificate.js @@ -31,7 +31,11 @@ function isCertified(frontEndIds, { completedChallenges, isFrontEndCert }) { if (isFrontEndCert) { return true; } - return _.every(frontEndIds, ({ id }) => _.some(completedChallenges, { id })); + return _.every(frontEndIds, ({ id }) => { + return _.some(completedChallenges, (challenge) => { + return challenge.id === id || challenge._id === id; + }); + }); } export default function certificate(app) {