Skip to content

Commit 510ccf7

Browse files
authored
Merge pull request #1370 from soerface/patch-1
Fix #1369 - make manage_users work again
2 parents f0c26b3 + 45d4daf commit 510ccf7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bin/manage_users

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ function getPass (argv, action) {
3737
async function createUser (argv) {
3838
const existingUser = await models.User.findOne({ where: { email: argv['add'] } })
3939
// Cannot create already-existing users
40-
if (existingUser !== undefined) {
40+
if (existingUser) {
4141
console.log(`User with e-mail ${existingUser.email} already exists! Aborting ...`)
42-
process.exit(1)
42+
process.exit(2)
4343
}
4444

4545
const pass = getPass(argv, 'add')
@@ -56,7 +56,7 @@ async function createUser (argv) {
5656
async function deleteUser (argv) {
5757
// Cannot delete non-existing users
5858
const existingUser = await models.User.findOne({ where: { email: argv['del'] } })
59-
if (existingUser === undefined) {
59+
if (!existingUser) {
6060
console.log(`User with e-mail ${argv['del']} does not exist, cannot delete`)
6161
process.exit(1)
6262
}
@@ -71,7 +71,7 @@ async function deleteUser (argv) {
7171
async function resetUser (argv) {
7272
const existingUser = await models.User.findOne({ where: { email: argv['reset'] } })
7373
// Cannot reset non-existing users
74-
if (existingUser === undefined) {
74+
if (!existingUser) {
7575
console.log(`User with e-mail ${argv['reset']} does not exist, cannot reset`)
7676
process.exit(1)
7777
}

0 commit comments

Comments
 (0)