1
0
Fork 0
mirror of synced 2024-09-30 00:57:16 +13:00

Don't perform account deletion check when self hosted

This commit is contained in:
Rory Powell 2021-10-11 11:14:44 +01:00
parent 6da4e25f0a
commit 9ea1774bcf
2 changed files with 11 additions and 9 deletions

View file

@ -5,7 +5,7 @@
// ***********************************************
//
Cypress.on('uncaught:exception', (err, runnable) => {
Cypress.on("uncaught:exception", () => {
return false
})

View file

@ -111,6 +111,7 @@ exports.destroy = async ctx => {
const db = getGlobalDB()
const dbUser = await db.get(ctx.params.id)
if (!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL) {
// root account holder can't be deleted from inside budibase
const email = dbUser.email
const account = await accounts.getAccount(email)
@ -121,6 +122,7 @@ exports.destroy = async ctx => {
ctx.throw(400, "Account holder cannot be deleted")
}
}
}
await removeUserFromInfoDB(dbUser)
await db.remove(dbUser._id, dbUser._rev)