mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: user_import: rename to draft
This commit is contained in:
1 parent
1ec793d039
commit
c250c8e925
3 files changed
+8
-4
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.20.37",
|
"version": "2.20.38",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -186,8 +186,8 @@ class SystemUserImportHandler extends SystemHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@param('users', Types.String)
|
@param('users', Types.String)
|
||||||
@param('confirm', Types.Boolean)
|
@param('draft', Types.Boolean)
|
||||||
async post(domainId: string, _users: string, confirm: boolean) {
|
async post(domainId: string, _users: string, draft: boolean) {
|
||||||
const users = _users.split('\n');
|
const users = _users.split('\n');
|
||||||
const udocs = [];
|
const udocs = [];
|
||||||
const tasks = [];
|
const tasks = [];
|
||||||
@@ -203,7 +203,7 @@ class SystemUserImportHandler extends SystemHandler {
|
|||||||
udocs.push({
|
udocs.push({
|
||||||
email, username, password, displayName,
|
email, username, password, displayName,
|
||||||
});
|
});
|
||||||
if (!confirm) {
|
if (!draft) {
|
||||||
tasks.push(
|
tasks.push(
|
||||||
(async () => {
|
(async () => {
|
||||||
const uid = await user.create(email, username, password);
|
const uid = await user.create(email, username, password);
|
||||||
|
|||||||
@@ -74,6 +74,10 @@ export class ProblemMainHandler extends ProblemHandler {
|
|||||||
page,
|
page,
|
||||||
system.get('pagination.problem'),
|
system.get('pagination.problem'),
|
||||||
);
|
);
|
||||||
|
if (q && +q) {
|
||||||
|
const pdoc = await problem.get(domainId, +q, this.user._id, problem.PROJECTION_LIST);
|
||||||
|
if (pdoc) pdocs.unshift(pdoc);
|
||||||
|
}
|
||||||
if (this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) {
|
if (this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) {
|
||||||
psdict = await problem.getListStatus(
|
psdict = await problem.getListStatus(
|
||||||
domainId, this.user._id, pdocs.map((pdoc) => pdoc.docId),
|
domainId, this.user._id, pdocs.map((pdoc) => pdoc.docId),
|
||||||
|
|||||||
Reference in new issue
Block a user