diff options
author | Daniel Axtens <dja@axtens.net> | 2020-04-14 14:26:58 +1000 |
---|---|---|
committer | Daniel Axtens <dja@axtens.net> | 2020-04-14 23:27:17 +1000 |
commit | 08c5856444bc2e100c4acbbea0a244cd46083c4b (patch) | |
tree | 5278109acb8e6e7b77e986feffd6bf52569d2437 /htdocs | |
parent | 4eaf300678df4d28b2cee4ad2f2de547daef5169 (diff) | |
download | patchwork-08c5856444bc2e100c4acbbea0a244cd46083c4b.tar patchwork-08c5856444bc2e100c4acbbea0a244cd46083c4b.tar.gz |
api: do not fetch every patch in a patch detail view 404
mpe and jk and sfr found that the OzLabs server was melting due
to some queries downloading every patch.
Turns out if you 404 the patch detail view in the API, d-r-f attempts
to render a listbox with every single patch to fill in the 'related'
field. The bundle API also has a similar field.
Replace the multiple selection box with a text field. You can still
(AIUI) populate the relevant patch IDs manually.
This is the recommended approach per
https://www.django-rest-framework.org/topics/browsable-api/#handling-choicefield-with-large-numbers-of-items
Reported-by: Jeremy Kerr <jk@ozlabs.org>
Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Tested-by: Jeremy Kerr <jk@ozlabs.org>
Server-no-longer-on-fire-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Diffstat (limited to 'htdocs')
0 files changed, 0 insertions, 0 deletions