diff --git a/index.js b/index.js
index b9c8e27116eaa443de70e4f210ec920370dfece3..336db81fec26a550f7e15b3c8c9de790f09204d7 100644
--- a/index.js
+++ b/index.js
@@ -228525,9 +228525,7 @@ async function saveAccountData(accountId, accountData) {
 async function getAccount(accountId) {
   log('info', `getAccount: ${accountId}`)
   const accounts = await cozyClient.data.findAll('io.cozy.accounts')
-  return accounts.filter(account =>
-    isLocal() ? account._id === accountId : account.account_type === accountId
-  )[0]
+  return accounts.filter(account => account.account_type === accountId)[0]
 }
 
 module.exports = { getAccount, saveAccountData }
diff --git a/onDeleteAccount.js b/onDeleteAccount.js
index 4ef3e5e5ab7365671ca8b5da699bb8f3a4591403..e8dd0b7640e665afe868e1b7aeeeb48bd1f27410 100644
--- a/onDeleteAccount.js
+++ b/onDeleteAccount.js
@@ -227426,9 +227426,7 @@ async function saveAccountData(accountId, accountData) {
 async function getAccount(accountId) {
   log('info', `getAccount: ${accountId}`)
   const accounts = await cozyClient.data.findAll('io.cozy.accounts')
-  return accounts.filter(account =>
-    isLocal() ? account._id === accountId : account.account_type === accountId
-  )[0]
+  return accounts.filter(account => account.account_type === accountId)[0]
 }
 
 module.exports = { getAccount, saveAccountData }