Skip to content

Commit 6b5dc91

Browse files
alexbruywonder-sk
authored andcommitted
address review
1 parent a56429d commit 6b5dc91

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

mergin/merginproject.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,15 @@ def project_id(self) -> str:
168168
self._read_metadata()
169169

170170
# "id" or "project_id" may not exist in projects downloaded with old client version
171-
if "id" not in self._metadata and "project_id" not in self._metadata:
172-
raise ClientError(
173-
"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."
174-
)
175-
176-
return self._metadata["project_id"] if "/" in self._metadata["name"] else self._metadata["id"]
171+
if self.is_old_metadata:
172+
if "project_id" not in self._metadata:
173+
raise ClientError(
174+
"The project directory has been created with an old version of the Mergin Maps client. "
175+
"Please delete the project directory and re-download the project."
176+
)
177+
return self._metadata["project_id"]
178+
else:
179+
return self._metadata["id"]
177180

178181
def workspace_id(self) -> int:
179182
"""Returns ID of the workspace where the project belongs"""

0 commit comments

Comments
 (0)