mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
core: update to mongodb5 (#514)
This commit is contained in:
1 parent
5a02010120
commit
0685b88066
59 files changed
+610
-601
No files matched your search
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable global-require */
|
||||
import {
|
||||
ContestModel, Context, Handler, ObjectID, param, PERM, PRIV, ProblemModel, Schema,
|
||||
ContestModel, Context, Handler, ObjectId, param, PERM, PRIV, ProblemModel, Schema,
|
||||
SettingModel, SystemModel, SystemSettings, Types, UserModel,
|
||||
} from 'hydrooj';
|
||||
import convert from 'schemastery-jsonschema';
|
||||
@@ -106,7 +106,7 @@ class RichMediaHandler extends Handler {
|
||||
async renderContest(domainId, payload) {
|
||||
const cur = payload.domainId ? await UserModel.getById(payload.domainId, this.user._id) : this.user;
|
||||
const tdoc = cur.hasPerm(PERM.PERM_VIEW | PERM.PERM_VIEW_CONTEST)
|
||||
? await ContestModel.get(payload.domainId || domainId, new ObjectID(payload.id))
|
||||
? await ContestModel.get(payload.domainId || domainId, new ObjectId(payload.id))
|
||||
: null;
|
||||
if (tdoc) return await this.renderHTML('partials/contest.html', { tdoc });
|
||||
return '';
|
||||
@@ -115,7 +115,7 @@ class RichMediaHandler extends Handler {
|
||||
async renderHomework(domainId, payload) {
|
||||
const cur = payload.domainId ? await UserModel.getById(payload.domainId, this.user._id) : this.user;
|
||||
const tdoc = cur.hasPerm(PERM.PERM_VIEW | PERM.PERM_VIEW_HOMEWORK)
|
||||
? await ContestModel.get(payload.domainId || domainId, new ObjectID(payload.id))
|
||||
? await ContestModel.get(payload.domainId || domainId, new ObjectId(payload.id))
|
||||
: null;
|
||||
if (tdoc) return await this.renderHTML('partials/homework.html', { tdoc });
|
||||
return '';
|
||||
|
||||
Reference in new issue
Block a user