diff --git a/catalystwan/api/admin_tech_api.py b/catalystwan/api/admin_tech_api.py index 17b14d74..13464083 100644 --- a/catalystwan/api/admin_tech_api.py +++ b/catalystwan/api/admin_tech_api.py @@ -146,7 +146,7 @@ def _wait_for_file_ready(self, filename: str, timeout: int = 3600, interval: int def _get_token_id(self, filename: str) -> str: admin_techs = self.get_all() for admin_tech in admin_techs: - if filename == admin_tech.filename: + if filename == admin_tech.filename and admin_tech.state == "done": return admin_tech.token_id raise RequestTokenIdNotFound( f"requestTokenId of admin tech generation request not found for file name: {filename}"