Skip to content
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

fix: user query parameter must include username [DHIS2-18748] #19611

Merged
merged 2 commits into from
Jan 9, 2025
Merged

Conversation

jbee
Copy link
Contributor

@jbee jbee commented Jan 7, 2025

Summary

When using the query parameter with User this should not run the standard implementation.
Therefore query needs to be considered a "special filter" and excluded for users.

This got overlooked when reworking the special filters in #19046 since the query parameter basically has a name clash.

Manual Testing

Using it to find system user by username once with other special filters and once without

  • /api/users?userOrgUnits=true&includeChildren=true&query=system
  • /api/users?query=system
  • check both URLs result in a list containing the system user (in SL this is the only match)

Automatic Testing

Added a controller test scenario that searches with query=system to match on the username.

@jbee jbee self-assigned this Jan 7, 2025
Copy link
Contributor

@david-mackessy david-mackessy left a comment

Choose a reason for hiding this comment

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

Can a test be added for this fix?

@jbee
Copy link
Contributor Author

jbee commented Jan 9, 2025

Can a test be added for this fix?

Added now

@jbee jbee requested a review from david-mackessy January 9, 2025 14:26
Copy link

sonarqubecloud bot commented Jan 9, 2025

@jbee jbee merged commit a132468 into master Jan 9, 2025
17 checks passed
@jbee jbee deleted the DHIS2-18748 branch January 9, 2025 15:09
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