+ def check_valid_wim_account(wim_account):
+ if not isinstance(wim_account, str):
+ return
+ elif wim_account in wim_accounts:
+ return
+ try:
+ db_filter = self._get_project_filter(session, write=False, show_all=True)
+ db_filter["_id"] = wim_account
+ self.db.get_one("wim_accounts", db_filter)
+ except Exception:
+ raise EngineException("Invalid wimAccountId='{}' not present for the project".format(wim_account))
+ wim_accounts.append(wim_account)
+