Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a223116

Browse files
committedApr 15, 2024
serializers: Optimize query performance on PatchDetailSerializer for 'patchinterest'
Signed-off-by: andrepapoti <[email protected]>
1 parent a696e41 commit a223116

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
 

Diff for: ‎patchwork/api/patch.py

+1
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ def get_queryset(self):
410410
'project',
411411
'series__project',
412412
'related__patches__project',
413+
'patchreviewintention_set__user',
413414
)
414415
.select_related('state', 'submitter', 'series')
415416
.defer('content', 'diff', 'headers')

Diff for: ‎patchwork/tests/api/test_patch.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def test_list_bug_335(self):
239239
series = create_series()
240240
create_patches(5, series=series)
241241

242-
with self.assertNumQueries(5):
242+
with self.assertNumQueries(6):
243243
self.client.get(self.api_url())
244244

245245
@utils.store_samples('patch-detail')

0 commit comments

Comments
 (0)
Please sign in to comment.