Don't perform account deletion check when self hosted
This commit is contained in:
parent
5ae5d8ddf0
commit
c0d46262bf
|
@ -5,7 +5,7 @@
|
||||||
// ***********************************************
|
// ***********************************************
|
||||||
//
|
//
|
||||||
|
|
||||||
Cypress.on('uncaught:exception', (err, runnable) => {
|
Cypress.on("uncaught:exception", () => {
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -111,14 +111,16 @@ exports.destroy = async ctx => {
|
||||||
const db = getGlobalDB()
|
const db = getGlobalDB()
|
||||||
const dbUser = await db.get(ctx.params.id)
|
const dbUser = await db.get(ctx.params.id)
|
||||||
|
|
||||||
// root account holder can't be deleted from inside budibase
|
if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) {
|
||||||
const email = dbUser.email
|
// root account holder can't be deleted from inside budibase
|
||||||
const account = await accounts.getAccount(email)
|
const email = dbUser.email
|
||||||
if (account) {
|
const account = await accounts.getAccount(email)
|
||||||
if (email === ctx.user.email) {
|
if (account) {
|
||||||
ctx.throw(400, 'Please visit "Account" to delete this user')
|
if (email === ctx.user.email) {
|
||||||
} else {
|
ctx.throw(400, 'Please visit "Account" to delete this user')
|
||||||
ctx.throw(400, "Account holder cannot be deleted")
|
} else {
|
||||||
|
ctx.throw(400, "Account holder cannot be deleted")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue