]> git.ipfire.org Git - thirdparty/patchwork.git/commit
REST: Handle regular form data requests for checks
authorDaniel Axtens <dja@axtens.net>
Mon, 29 Apr 2019 15:33:16 +0000 (01:33 +1000)
committerDaniel Axtens <dja@axtens.net>
Tue, 30 Apr 2019 04:50:05 +0000 (14:50 +1000)
commit666de29ebada5990a8d69f4d71d6bb271e1a68c3
tree0e4fe63a77035fc60e5df3fe899e8a01f46cf983
parentd0b79d9dee04aee13c8d64a193a7818f72eeca3b
REST: Handle regular form data requests for checks

08d1459a4a40 ("Add REST API validation using OpenAPI schema") moved
all API requests to JSON blobs rather than form data.

dc48fbce99ef ("REST: Handle JSON requests") attempted to change the
check serialiser to handle this. However, because both a JSON dict
and a QueryDict satisfy isinstance(data, dict), everything was handled
as JSON and the old style requests were broken.

Found in the process of debugging issues from the OzLabs PW & Snowpatch
crew - I'm not sure if they actually hit this one, but kudos to them
anyway as we wouldn't have found it without them.

Fixes: dc48fbce99ef ("REST: Handle JSON requests")
Signed-off-by: Daniel Axtens <dja@axtens.net>
patchwork/api/check.py
patchwork/tests/api/test_check.py