Skip to content

Commit

Permalink
refetch project uuid if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
jalexanderII committed Jul 22, 2024
1 parent edb6be1 commit defb0e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parea/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __attrs_post_init__(self):
if project_api_response.was_created:
print(f"Created project {project_api_response.name}")
self._project = structure(asdict(project_api_response), ProjectSchema)
parea_logger.set_project_uuid(self.project_uuid, self.project_name)
parea_logger.set_project_uuid(self._project.uuid, self.project_name)
except httpx.HTTPStatusError as e:
if e.response.status_code == 502:
logger.error("Error creating Parea project please try again")
Expand All @@ -92,7 +92,7 @@ def _get_project_uuid(self) -> Optional[str]:
if not (self._project and self._project.uuid):
project_api_response: CreateGetProjectResponseSchema = self._create_or_get_project(self.project_name or "default")
self._project = structure(asdict(project_api_response), ProjectSchema)
parea_logger.set_project_uuid(self.project_uuid, self.project_name)
parea_logger.set_project_uuid(self._project.uuid, self.project_name)
try:
return self._project.uuid
except Exception as e:
Expand Down

0 comments on commit defb0e1

Please sign in to comment.