Skip to content

Commit

Permalink
serializers: Optimize query performance on PatchDetailSerializer for …
Browse files Browse the repository at this point in the history
…'patchinterest'

Signed-off-by: andrepapoti <[email protected]>
  • Loading branch information
andrepapoti committed Apr 15, 2024
1 parent a696e41 commit a223116
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions patchwork/api/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ def get_queryset(self):
'project',
'series__project',
'related__patches__project',
'patchreviewintention_set__user',
)
.select_related('state', 'submitter', 'series')
.defer('content', 'diff', 'headers')
Expand Down
2 changes: 1 addition & 1 deletion patchwork/tests/api/test_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def test_list_bug_335(self):
series = create_series()
create_patches(5, series=series)

with self.assertNumQueries(5):
with self.assertNumQueries(6):
self.client.get(self.api_url())

@utils.store_samples('patch-detail')
Expand Down

0 comments on commit a223116

Please sign in to comment.