Skip to content

Commit

Permalink
implement workspace_id getter
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy authored and wonder-sk committed Nov 8, 2023
1 parent 8ac86fd commit d6942d5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mergin/merginproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,16 @@ def workspace_id(self) -> int:
"""Returns ID of the workspace where the project belongs"""
# unfortunately we currently do not have information about workspace ID
# in project's metadata...
raise NotImplementedError
if self._metadata is None:
self._read_metadata()

# "workspace_id" does not exist in projects downloaded with old client version
if self.is_old_metadata:
raise ClientError(
"The project directory has been created with an old version of the Mergin Maps client. "
"Please delete the project directory and re-download the project."
)
return self._metadata["workspace_id"]

def version(self) -> str:
"""Returns project version (e.g. "v123")"""
Expand Down

0 comments on commit d6942d5

Please sign in to comment.