We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b27a0f commit 71b2bceCopy full SHA for 71b2bce
atlassian/bitbucket/__init__.py
@@ -297,6 +297,21 @@ def project(self, key):
297
url = self._url_project(key)
298
return self.get(url) or {}
299
300
+ def project_exists(self, project_key):
301
+ """
302
+ Check if project with the provided project key exists and available.
303
+ :param project_key: Key of the project where to check for repository.
304
+ :return: False is requested repository doesn't exist in the project or not accessible to the requestor
305
306
+ exists = False
307
+ try:
308
+ self.project(project_key)
309
+ exists = True
310
+ except HTTPError as e:
311
+ if e.response.status_code in (401, 404):
312
+ pass
313
+ return exists
314
+
315
def update_project(self, key, **params):
316
"""
317
Update project
0 commit comments