Skip to content

Commit 534f55a

Browse files
committed
Add compatibility check
1 parent 3c08328 commit 534f55a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

mergin/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,9 @@ def create_invitation(self, workspace_id: int, email: str, workspace_role: Works
14491449
"""
14501450
Create invitation to workspace for specific role
14511451
"""
1452+
min_version = "2025.6.1"
1453+
if not is_version_acceptable(self.server_version(), min_version):
1454+
raise NotImplementedError(f"This needs server at version {min_version} or later")
14521455
params = {"email": email, "role": workspace_role.value}
14531456
ws_inv = self.post(f"v2/workspaces/{workspace_id}/invitations", params, json_headers)
14541457
return json.load(ws_inv)

mergin/test/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2912,7 +2912,7 @@ def test_do_request_error_handling(mc: MerginClient):
29122912
assert "Passwords must be at least 8 characters long." in e.value.detail
29132913

29142914

2915-
def test_creat_invitation(mc: MerginClient):
2915+
def test_create_invitation(mc: MerginClient):
29162916
"""Test client method to create workspace invitation"""
29172917
workspace_id = next((w["id"] for w in mc.workspaces_list() if w["name"] == mc.username()))
29182918
role = WorkspaceRole.WRITER

0 commit comments

Comments
 (0)