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

IA-2985 Org Unit Tree API bug fixes #1337

Merged

Conversation

kemar
Copy link
Member

@kemar kemar commented May 29, 2024

Org Unit Tree API bug fixes.

Related JIRA tickets : IA-2985

Changes

  • Fix N+1 when fetching parents
  • Fix filtering of Org Units by account
  • Filter by default version when no data_source_id is given

Notes

parent is not returned by default.

You have to call the API with &fields=:all, eg:

http://localhost:8081/api/orgunits/tree/search/?search=congo&page=2&fields=:all

@kemar kemar self-assigned this May 29, 2024
@kemar kemar requested a review from madewulf May 29, 2024 14:18
@@ -122,13 +122,13 @@ def test_root_with_force_full_tree(self):
def test_specific_level_with_force_full_tree(self):
self.client.force_authenticate(self.user)

with self.assertNumQueries(1):
with self.assertNumQueries(3):
Copy link
Member

Choose a reason for hiding this comment

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

It's cool that there is this assertion now.

@beygorghor beygorghor merged commit ee7cd8e into IA-2985-org-unit-tree-new-api Jun 4, 2024
3 checks passed
@beygorghor beygorghor deleted the IA-2985-org-unit-tree-new-api-fixes branch June 4, 2024 07:14
@kemar kemar added release Should be released in production at next deploy Released and removed release Should be released in production at next deploy labels Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants