Skip to content

Commit

Permalink
Fix: CI + add prefetch_related for tenant_user
Browse files Browse the repository at this point in the history
  • Loading branch information
bramj committed Oct 24, 2024
1 parent 646e846 commit c8142a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions iaso/api/profiles/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ def list(self, request):
queryset = queryset.prefetch_related(
"user",
"user_roles",
"user__tenant_user",
"org_units",
"org_units__version",
"org_units__version__data_source",
Expand Down
2 changes: 1 addition & 1 deletion iaso/tests/api/test_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def test_profile_list_read_only_permissions(self):
"""GET /profiles/ with auth (user has read only permissions)"""

self.client.force_authenticate(self.jane)
with self.assertNumQueries(11):
with self.assertNumQueries(12):
response = self.client.get("/api/profiles/")
self.assertJSONResponse(response, 200)
profile_url = "/api/profiles/%s/" % self.jane.iaso_profile.id
Expand Down

0 comments on commit c8142a9

Please sign in to comment.