Skip to content

Commit 3c252f6

Browse files
authored
Merge pull request #405 from superannotateai/friday-781-project-metadata
remove contributors
2 parents 0b69ac8 + e504ec3 commit 3c252f6

File tree

4 files changed

+2
-24
lines changed

4 files changed

+2
-24
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def create_project(
181181
def create_project_from_metadata(project_metadata: Project):
182182
"""Create a new project in the team using project metadata object dict.
183183
Mandatory keys in project_metadata are "name", "description" and "type" (Vector or Pixel)
184-
Non-mandatory keys: "workflow", "contributors", "settings" and "annotation_classes".
184+
Non-mandatory keys: "workflow", "settings" and "annotation_classes".
185185
186186
:return: dict object metadata the new project
187187
:rtype: dict
@@ -191,7 +191,6 @@ def create_project_from_metadata(project_metadata: Project):
191191
name=project_metadata["name"],
192192
description=project_metadata["description"],
193193
project_type=project_metadata["type"],
194-
contributors=project_metadata.get("contributors", []),
195194
settings=project_metadata.get("settings", []),
196195
annotation_classes=project_metadata.get("classes", []),
197196
workflows=project_metadata.get("workflows", []),

src/superannotate/lib/core/usecases/projects.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ def __init__(
168168
settings: List[ProjectSettingEntity] = None,
169169
workflows: List[WorkflowEntity] = None,
170170
annotation_classes: List[AnnotationClassEntity] = None,
171-
contributors: Iterable[dict] = None,
172171
):
173172

174173
super().__init__()
@@ -180,7 +179,6 @@ def __init__(
180179
self._workflows_repo = workflows_repo
181180
self._workflows = workflows
182181
self._annotation_classes = annotation_classes
183-
self._contributors = contributors
184182
self._backend_service = backend_service_provider
185183

186184
def validate_project_name(self):
@@ -258,22 +256,6 @@ def execute(self):
258256
self._response.errors = set_workflow_response.errors
259257
data["workflows"] = self._workflows
260258

261-
if self._contributors:
262-
for contributor in self._contributors:
263-
self._backend_service.share_project_bulk(
264-
team_id=entity.team_id,
265-
project_id=entity.uuid,
266-
users=[
267-
{
268-
"user_id": contributor["user_id"],
269-
"user_role": constances.UserRole.get_value(
270-
contributor["user_role"]
271-
),
272-
}
273-
],
274-
)
275-
data["contributors"] = self._contributors
276-
277259
logger.info(
278260
"Created project %s (ID %s) with type %s",
279261
self._response.data.name,

src/superannotate/lib/infrastructure/controller.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ def create_project(
292292
name: str,
293293
description: str,
294294
project_type: str,
295-
contributors: Iterable = tuple(),
296295
settings: Iterable = tuple(),
297296
annotation_classes: Iterable = tuple(),
298297
workflows: Iterable = tuple(),
@@ -324,8 +323,7 @@ def create_project(
324323
annotation_classes=[
325324
AnnotationClassEntity(**annotation_class)
326325
for annotation_class in annotation_classes
327-
],
328-
contributors=contributors,
326+
]
329327
)
330328
return use_case.execute()
331329

tests/integration/projects/test_basic_project.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def test_create_project_from_metadata(self):
9393
include_annotation_classes=True
9494
)
9595
self.assertEqual(len(created["classes"]), 1)
96-
self.assertEqual(len(created["contributors"]), 1)
9796
self.assertEqual([f"{i['attribute']}_{i['value']}" for i in meta["settings"]],
9897
[f"{i['attribute']}_{i['value']}" for i in created["settings"]])
9998
self.assertEqual(len(created['workflows']), 1)

0 commit comments

Comments
 (0)