Skip to content

Commit

Permalink
client: fix delete_project
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaume committed May 12, 2023
1 parent fc06e0a commit ce99a87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mpcontribs-client/mpcontribs/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,8 +989,11 @@ def delete_project(self, name: str = None):
if not name:
raise MPContribsClientError("initialize client with project or set `name` argument!")

if not self.get_totals(query={"name": name}, resource="projects")[0]:
raise MPContribsClientError(f"Project `{name}` doesn't exist!")

resp = self.projects.deleteProjectByName(pk=name).result()
if "error" in resp:
if resp and "error" in resp:
raise MPContribsClientError(resp["error"])

def get_contribution(self, cid: str) -> Type[Dict]:
Expand Down

0 comments on commit ce99a87

Please sign in to comment.