Skip to content

Commit

Permalink
Merge pull request #978 from CitrineInformatics/revert-977-bugfix/use…
Browse files Browse the repository at this point in the history
…-generic-for-project-register

Revert "Update project register routing"
  • Loading branch information
pacdaemon authored Nov 15, 2024
2 parents ce9b368 + ecce023 commit 331afee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/citrine/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.11.3"
__version__ = "3.11.4"
10 changes: 8 additions & 2 deletions src/citrine/resources/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from citrine._serialization import properties
from citrine._session import Session
from citrine._utils.functions import format_escaped_url
from citrine.exceptions import NonRetryableException, ModuleRegistrationFailedException
from citrine.resources.api_error import ApiError
from citrine.resources.branch import BranchCollection
from citrine.resources.dataset import DatasetCollection
Expand Down Expand Up @@ -591,7 +592,12 @@ def register(self, name: str, *, description: Optional[str] = None) -> Project:
"Use team.projects.register.")

project = Project(name, description=description)
return super().register(project)
try:
data = self.session.post_resource(self._get_path(), project.dump())
data = data[self._individual_key]
return self.build(data)
except NonRetryableException as e:
raise ModuleRegistrationFailedException(project.__class__.__name__, e)

def list(self, *, per_page: int = 1000) -> Iterator[Project]:
"""
Expand Down Expand Up @@ -735,7 +741,7 @@ def delete(self, uid: Union[UUID, str]) -> Response:
If the project is not empty, then the Response will contain a list of all of the project's
resources. These must be deleted before the project can be deleted.
"""
# Only the team-agnostic project delete is implemented
# Only the team-agnostic project get is implemented
if self.team_id is None:
return super().delete(uid)
else:
Expand Down

0 comments on commit 331afee

Please sign in to comment.