Skip to content

fix: Make name/email lookups case-insensitive (#5972)#6007

Merged
rjsparks merged 2 commits intoietf-tools:mainfrom
richsalz:fix-5972
Jul 22, 2023
Merged

fix: Make name/email lookups case-insensitive (#5972)#6007
rjsparks merged 2 commits intoietf-tools:mainfrom
richsalz:fix-5972

Conversation

@richsalz
Copy link
Copy Markdown
Collaborator

Use icontains so that looking up name or email is case insensitive Added a test

Use icontains so that looking up name or email is case insensitive
Added a test

Fixes: 5972
@richsalz richsalz changed the title fix: Make name/email lookups case-insensitive (5972) fix: Make name/email lookups case-insensitive (#5972) Jul 22, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 22, 2023

Codecov Report

Merging #6007 (554cd68) into main (09f3477) will decrease coverage by 0.05%.
The diff coverage is 86.66%.

❗ Current head 554cd68 differs from pull request most recent head 52b3ed6. Consider uploading reports for the commit 52b3ed6 to get more accurate results

@@            Coverage Diff             @@
##             main    #6007      +/-   ##
==========================================
- Coverage   88.67%   88.63%   -0.05%     
==========================================
  Files         288      288              
  Lines       40001    40014      +13     
==========================================
- Hits        35471    35466       -5     
- Misses       4530     4548      +18     
Impacted Files Coverage Δ
ietf/doc/views_stats.py 74.80% <ø> (ø)
ietf/ietfauth/widgets.py 84.61% <ø> (ø)
ietf/nomcom/views.py 92.90% <33.33%> (-0.22%) ⬇️
ietf/doc/utils.py 87.15% <100.00%> (+0.01%) ⬆️
ietf/nomcom/templatetags/nomcom_tags.py 70.83% <100.00%> (+3.64%) ⬆️
ietf/person/views.py 77.77% <100.00%> (ø)
ietf/submit/forms.py 79.02% <100.00%> (+0.03%) ⬆️

... and 2 files with indirect coverage changes

@jennifer-richards
Copy link
Copy Markdown
Member

Would using __iexact instead of __icontains fix this without opening up a search like you describe in #6008?

@richsalz
Copy link
Copy Markdown
Collaborator Author

Yes, that would fix the web search, but ajax_select2_search still uses __icontains so the API would still have the problem. And searching for people by things like salz is useful. (I thought there was an open issue for that, but I can't find it.)

Comment thread ietf/person/views.py Outdated

def profile(request, email_or_name):
aliases = Alias.objects.filter(name=email_or_name)
aliases = Alias.objects.filter(name__icontains=email_or_name)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about iexact instead of icontains in both places?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added commit to do this.
(It was useful to each just 'salz' but not worth the #6008 risk)

@rjsparks rjsparks merged commit 9aea2a2 into ietf-tools:main Jul 22, 2023
@richsalz richsalz deleted the fix-5972 branch July 22, 2023 23:53
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants