-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨(backend) allow to filter member on team access endpoint #200
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mjeammet
force-pushed
the
sdem/teamaccess_filtermb
branch
from
April 26, 2024 15:28
fea999d
to
276a385
Compare
mjeammet
reviewed
Apr 29, 2024
src/backend/core/api/viewsets.py
Outdated
Comment on lines
358
to
377
if query := self.request.GET.get("q", ""): | ||
similarity = Max( | ||
TrigramSimilarity( | ||
Coalesce( | ||
Func("user__identities__email", function="unaccent"), Value("") | ||
), | ||
Func(Value(query), function="unaccent"), | ||
) | ||
+ TrigramSimilarity( | ||
Coalesce( | ||
Func("user__identities__name", function="unaccent"), Value("") | ||
), | ||
Func(Value(query), function="unaccent"), | ||
) | ||
) | ||
queryset = ( | ||
queryset.annotate(similarity=similarity) | ||
.filter(similarity__gte=SIMILARITY_THRESHOLD) | ||
.order_by("-similarity") | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be a little lower, inside the list/retrieve "if" ?
mjeammet
reviewed
Apr 29, 2024
client.force_login(user) | ||
|
||
response = client.get( | ||
f"/api/v1.0/teams/{team.id!s}/accesses/?q=BRU", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't work and I'm not sure why 🤔
sdemagny
force-pushed
the
sdem/teamaccess_filtermb
branch
from
June 4, 2024 09:11
0a92b13
to
434182b
Compare
sdemagny
force-pushed
the
sdem/teamaccess_filtermb
branch
5 times, most recently
from
July 18, 2024 22:24
9200fa9
to
bbdd4e8
Compare
sdemagny
force-pushed
the
sdem/teamaccess_filtermb
branch
2 times, most recently
from
July 19, 2024 13:56
4620ab1
to
5333e2d
Compare
mjeammet
approved these changes
Jul 31, 2024
sdemagny
force-pushed
the
sdem/teamaccess_filtermb
branch
from
July 31, 2024 13:58
6c85e91
to
727118a
Compare
Filter member by name...
sdemagny
force-pushed
the
sdem/teamaccess_filtermb
branch
from
July 31, 2024 14:01
727118a
to
ab54d5a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Filter member by main identity name or email.
Proposal
Description...