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

project_exists should not fail if no project exist in the org #15

Merged
merged 1 commit into from
Feb 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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