Skip to content

Commit

Permalink
Update error message for duplicate invite
Browse files Browse the repository at this point in the history
  • Loading branch information
olarid7852 committed Jan 13, 2025
1 parent 6ae54f1 commit a77ea90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/teams/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,12 @@ def bulk_create(self, request, *args, **kwargs):
})
user_emails = [item['email'] for item in serializer.validated_data]
if Membership.objects.filter(user__email__in=user_emails, team=team).count() > 0:
emails = [member.user.email for user in Membership.objects.filter(
emails = [member.user.email for member in Membership.objects.filter(
user__email__in=user_emails, team=team).select_related('user')]
email_str = ", ".join(emails)
raise DRFValidationError({
"code": "E02",
"message": f"User with email ({email_str}) already exists"
"message": f"Member with email ({email_str}) already exists"
})

for item in serializer.validated_data:
Expand Down

0 comments on commit a77ea90

Please sign in to comment.