Skip to content

Conversation

@rw-bsi
Copy link
Contributor

@rw-bsi rw-bsi commented Sep 21, 2025

Result of this at DB level (compare via UPPER(...) = UPPER(...) is what __iexact does):

EXPLAIN SELECT * from auth_user WHERE upper(username) = upper('rOOt');

Index Scan using auth_user_username_ci_idx on auth_user  (cost=0.14..8.16 rows=1 width=1767)
  Index Cond: (upper((username)::text) = 'ROOT'::text)

Confirmed it is now using an index.

@rw-bsi rw-bsi requested a review from civilx64 September 21, 2025 10:29
@rw-bsi rw-bsi self-assigned this Sep 21, 2025
@rw-bsi rw-bsi requested a review from Ghesselink September 26, 2025 11:53
Copy link
Contributor

@Ghesselink Ghesselink left a comment

Choose a reason for hiding this comment

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

Were we running tests.py somewhere, or is it just for local testing?

Seems to work though :-)

>>> UserAdditionalInfo.find_user_by_username('johndoe') == UserAdditionalInfo.find_user_by_username('JOHNDOE')
True

@rw-bsi
Copy link
Contributor Author

rw-bsi commented Sep 28, 2025

Were we running tests.py somewhere, or is it just for local testing?

@Ghesselink Tests are ran in the CI/CD pipeline of Validate repo

https://github.com/buildingSMART/validate/blob/db98f3eb5e7a068e7abbfc5dd6f774e804848641/.github/workflows/ci_cd.yml#L97-L105

@rw-bsi rw-bsi merged commit 3a4c020 into development Sep 28, 2025
@rw-bsi rw-bsi deleted the IVS-629_Ignore_case_matching_usernames branch September 28, 2025 08:54
@Ghesselink
Copy link
Contributor

@rw-bsi

@Ghesselink Tests are ran in the CI/CD pipeline of Validate repo

Oh d'oh, of course ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants