Skip to content

Commit d58cff0

Browse files
committed
api: do not fetch every patch in a patch detail view 404 (v2)
Commit 08c5856 fixed an issue whereby a 404 on the aforementioned URL could result in a large DB query due to DRF attempting to populate the 'related' list box with all patches on the instance. That was accidentally reverted in commit fe07f30. "Unrevert" this change. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: fe07f30 ("Remove 'PatchRelationSerializer'") Closes: #397 (cherry picked from commit 79700f3)
1 parent f4ee6e8 commit d58cff0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

patchwork/api/patch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ class PatchListSerializer(BaseHyperlinkedModelSerializer):
8484
checks = SerializerMethodField()
8585
tags = SerializerMethodField()
8686
related = PatchSerializer(
87-
source='related.patches', many=True, default=[])
87+
source='related.patches', many=True, default=[],
88+
style={'base_template': 'input.html'})
8889

8990
def get_web_url(self, instance):
9091
request = self.context.get('request')

0 commit comments

Comments
 (0)