Skip to content

Commit cf475b4

Browse files
authored
Merge pull request #374 from superannotateai/mix_events
Mix events
2 parents ab3bb84 + c1686ac commit cf475b4

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

src/superannotate/lib/app/interface/sdk_interface.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2804,8 +2804,8 @@ def add_contributors_to_project(
28042804
:param role: user role to apply, one of Admin , Annotator , QA
28052805
:type role: str
28062806
2807-
return: lists of added, skipped contributors of the project
2808-
rtype: tuple (2 members) of lists of strs
2807+
:return: lists of added, skipped contributors of the project
2808+
:rtype: tuple (2 members) of lists of strs
28092809
"""
28102810
response = controller.add_contributors_to_project(
28112811
project_name=project, emails=emails, role=role
@@ -2828,8 +2828,8 @@ def invite_contributors_to_team(
28282828
:param admin: enables admin privileges for the contributor
28292829
:type admin: bool
28302830
2831-
return: lists of invited, skipped contributors of the team
2832-
rtype: tuple (2 members) of lists of strs
2831+
:return: lists of invited, skipped contributors of the team
2832+
:rtype: tuple (2 members) of lists of strs
28332833
"""
28342834
response = controller.invite_contributors_to_team(emails=emails, set_admin=admin)
28352835
if response.errors:

src/superannotate/lib/app/mixp/utils/parsers.py

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ def get_team_metadata(*args, **kwargs):
2424

2525
def invite_contributors_to_team(*args, **kwargs):
2626
admin = kwargs.get("admin", None)
27-
if not admin:
27+
if admin is None:
2828
admin = args[1:2]
29-
if admin:
30-
admin = "CUSTOM"
29+
if not admin:
30+
admin_value = False
31+
if admin:
32+
admin_value = admin[0]
3133
else:
32-
admin = "DEFAULT"
33-
return {"event_name": "invite_contributors_to_team", "properties": {"Admin": admin}}
34+
admin_value = admin
35+
return {"event_name": "invite_contributors_to_team", "properties": {"Admin": admin_value}}
3436

3537

3638
def search_team_contributors(*args, **kwargs):
@@ -1071,9 +1073,17 @@ def aggregate_annotations_as_df(*args, **kwargs):
10711073
if folder_names is None:
10721074
folder_names = []
10731075

1076+
project_type = kwargs.get("project_type", None)
1077+
if not project_type:
1078+
project_type = args[1]
1079+
10741080
return {
10751081
"event_name": "aggregate_annotations_as_df",
1076-
"properties": {"Folder Count": len(folder_names)},
1082+
"properties": {
1083+
"Folder Count": len(folder_names),
1084+
"Project Type": project_type
1085+
1086+
},
10771087
}
10781088

10791089

@@ -1185,3 +1195,14 @@ def validate_annotations(*args, **kwargs):
11851195
"event_name": "validate_annotations",
11861196
"properties": {"Project Type": project_type},
11871197
}
1198+
1199+
1200+
def add_contributors_to_project(*args, **kwargs):
1201+
user_role = kwargs.get("role", None)
1202+
if not user_role:
1203+
user_role = args[2:3]
1204+
1205+
return {
1206+
"event_name": "add_contributors_to_project",
1207+
"properties": {"User Role": user_role},
1208+
}

0 commit comments

Comments
 (0)