From 45ba7f7c92eddad245aca78e4ec2fbf0f0c4b80c Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Fri, 17 Feb 2023 08:51:22 +0100 Subject: [PATCH] project_exists should not fail if no project exist in the org (#15) --- pytransifex/api.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pytransifex/api.py b/pytransifex/api.py index 75ed89e..aaba840 100644 --- a/pytransifex/api.py +++ b/pytransifex/api.py @@ -238,13 +238,9 @@ def create_language( @ensure_login def project_exists(self, project_slug: str) -> bool: """Check if the project exists in the remote Transifex repository""" - if self.projects: - if self.projects.get(slug=project_slug): - return True - return False - raise Exception( - f"No project could be found under this organization: '{self.organization}'" - ) + if self.projects and self.projects.get(slug=project_slug): + return True + return False @ensure_login def ping(self) -> bool: