✨(backend) enhance search users to add in a team
Exclude from the result all users already members of the current team
This commit is contained in:
@@ -206,6 +206,10 @@ class UserViewSet(
|
||||
)
|
||||
)
|
||||
|
||||
# Exclude all users already in the given team
|
||||
if team_id := self.request.GET.get("team_id", ""):
|
||||
queryset = queryset.exclude(teams__id=team_id)
|
||||
|
||||
# Search by case-insensitive and accent-insensitive trigram similarity
|
||||
if query := self.request.GET.get("q", ""):
|
||||
similarity = Max(
|
||||
|
||||
Reference in New Issue
Block a user