diff --git a/src/superannotate/lib/core/usecases/base.py b/src/superannotate/lib/core/usecases/base.py index 19e1a4fa3..c3a4625d2 100644 --- a/src/superannotate/lib/core/usecases/base.py +++ b/src/superannotate/lib/core/usecases/base.py @@ -74,11 +74,11 @@ def __init__(self, reporter: Reporter, emails: List[str]): def validate_emails(self): emails_to_add = set() - duplicated_emails = [ + unique_emails = [ email for email in self._emails if email not in emails_to_add and not emails_to_add.add(email) ] - if duplicated_emails: + if unique_emails: self.reporter.log_info( - f"Dropping duplicates. Found {len(duplicated_emails)}/{len(self._emails)} unique users." + f"Dropping duplicates. Found {len(unique_emails)}/{len(self._emails)} unique users." ) self._emails = emails_to_add diff --git a/src/superannotate/lib/core/usecases/projects.py b/src/superannotate/lib/core/usecases/projects.py index 30880449c..fdb1dd6a4 100644 --- a/src/superannotate/lib/core/usecases/projects.py +++ b/src/superannotate/lib/core/usecases/projects.py @@ -1036,7 +1036,7 @@ def execute(self): to_skip = list(emails.intersection(team_users)) to_add = list(emails.difference(to_skip)) - + invited, failed = [], emails if to_skip: self.reporter.log_warning( f"Found {len(to_skip)}/{len(self._emails)} existing members of the team." @@ -1058,5 +1058,5 @@ def execute(self): f"Skipped team {'admin' if self._set_admin else 'contributor'} " f"invitations for {len(failed)}/{len(self._emails)} users." ) - self._response.data = to_add, to_skip + self._response.data = invited, failed return self._response