core: fix training enrollUser (#750)

This commit is contained in:
panda authored and GitHub committed 2024-03-13 21:04:54 +08:00
1 parent 731c6e728d
commit 3794bef262
1 file changed
+1 -1
+1 -1
View File
@@ -105,7 +105,7 @@ class TrainingDetailHandler extends Handler {
let shouldCompare = false;
const pids = training.getPids(tdoc.dag);
if (this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) {
enrollUsers = (await training.getMultiStatus(domainId, { docId: tid, uid: { $gt: 1 } })
enrollUsers = (await training.getMultiStatus(domainId, { docId: tid, uid: { $gt: 1 }, enroll: 1 })
.project({ uid: 1 }).limit(500).toArray()).map((x) => +x.uid);
shouldCompare = uid !== this.user._id;
} else uid = this.user._id;