Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
project_exists should not fail if no project exist in the org (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids authored Feb 17, 2023
1 parent a7b5b17 commit 45ba7f7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pytransifex/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 45ba7f7

Please sign in to comment.