mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -04:00
Merge pull request #235 from soerface/issue-234
Fix #234 - make manage_users work again
This commit is contained in:
commit
472ae01546
1 changed files with 4 additions and 4 deletions
|
@ -36,9 +36,9 @@ function getPass(argv, action) {
|
||||||
async function createUser(argv) {
|
async function createUser(argv) {
|
||||||
const existing_user = await models.User.findOne({where: {email: argv["add"]}});
|
const existing_user = await models.User.findOne({where: {email: argv["add"]}});
|
||||||
// Cannot create already-existing users
|
// Cannot create already-existing users
|
||||||
if(existing_user != undefined) {
|
if(existing_user) {
|
||||||
console.log(`User with e-mail ${existing_user.email} already exists! Aborting ...`);
|
console.log(`User with e-mail ${existing_user.email} already exists! Aborting ...`);
|
||||||
process.exit(1);
|
process.exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
const pass = getPass(argv, "add");
|
const pass = getPass(argv, "add");
|
||||||
|
@ -57,7 +57,7 @@ async function createUser(argv) {
|
||||||
async function deleteUser(argv) {
|
async function deleteUser(argv) {
|
||||||
// Cannot delete non-existing users
|
// Cannot delete non-existing users
|
||||||
const existing_user = await models.User.findOne({where: {email: argv["del"]}});
|
const existing_user = await models.User.findOne({where: {email: argv["del"]}});
|
||||||
if(existing_user === undefined) {
|
if(!existing_user) {
|
||||||
console.log(`User with e-mail ${argv["del"]} does not exist, cannot delete`);
|
console.log(`User with e-mail ${argv["del"]} does not exist, cannot delete`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ async function deleteUser(argv) {
|
||||||
async function resetUser(argv) {
|
async function resetUser(argv) {
|
||||||
const existing_user = await models.User.findOne({where: {email: argv["reset"]}});
|
const existing_user = await models.User.findOne({where: {email: argv["reset"]}});
|
||||||
// Cannot reset non-existing users
|
// Cannot reset non-existing users
|
||||||
if(existing_user == undefined) {
|
if(!existing_user) {
|
||||||
console.log(`User with e-mail ${argv["reset"]} does not exist, cannot reset`);
|
console.log(`User with e-mail ${argv["reset"]} does not exist, cannot reset`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue