Fixed update query to revert challenge tags when broken (#9791)

This commit is contained in:
Keith Holliday
2018-01-15 10:31:33 -07:00
committed by GitHub
parent 745f930749
commit 935fa1baae
2 changed files with 9 additions and 3 deletions

View File

@@ -341,7 +341,7 @@ schema.methods.closeChal = async function closeChal (broken = {}) {
// Set the challenge tag to non-challenge status and remove the challenge from the user's challenges
User.update({
challenges: challenge._id,
'tags._id': challenge._id,
'tags.id': challenge._id,
}, {
$set: {'tags.$.challenge': false},
$pull: {challenges: challenge._id},