Skip to content

Commit 68b5405

Browse files
committed
Add deprecated coming soon warning
1 parent cccddff commit 68b5405

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mergin/client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,12 @@ def add_user_permissions_to_project(self, project_path, usernames, permission_le
804804
if permission_level in ("writer", "owner", "editor", "reader"):
805805
access.get("readersnames").append(name)
806806
self.set_project_access(project_path, access)
807+
warnings.warn(
808+
"This method will be deprecated in the next major release (1.0.0)"
809+
"Use `add_project_collaborator` to create a project permission and "
810+
"`update_project_collaborator` to change it instead.",
811+
category=DeprecationWarning,
812+
)
807813

808814
def remove_user_permissions_from_project(self, project_path, usernames):
809815
"""
@@ -823,6 +829,11 @@ def remove_user_permissions_from_project(self, project_path, usernames):
823829
if name in access.get("readersnames", []):
824830
access.get("readersnames").remove(name)
825831
self.set_project_access(project_path, access)
832+
warnings.warn(
833+
"This method will be deprecated in the next major release (1.0.0)"
834+
"Use `remove_project_collaborator` instead.",
835+
category=DeprecationWarning,
836+
)
826837

827838
def project_user_permissions(self, project_path):
828839
"""

0 commit comments

Comments
 (0)