]> git.ipfire.org Git - thirdparty/patchwork.git/commit
REST: Handle regular form data requests for checks
authorDaniel Axtens <dja@axtens.net>
Tue, 30 Apr 2019 06:03:03 +0000 (16:03 +1000)
committerStephen Finucane <stephen@that.guru>
Tue, 30 Apr 2019 17:37:03 +0000 (11:37 -0600)
commitd963655ccd89c68648dbe3b2843a4a7b06aa78ce
tree62fc586e29978d8a327bf8d693e5d243f11f777a
parentb7aa6f1f62c56dade7dd524ebcba58546fb07f6b
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.

NOTE(daxtens): This does not need the new tests as we do not have
08d1459a4a40, so we just need the fix to the API. We do not add a JSON
test to stable.

Fixes: dc48fbce99ef ("REST: Handle JSON requests")
Signed-off-by: Daniel Axtens <dja@axtens.net>
(cherry picked from commit 666de29ebada5990a8d69f4d71d6bb271e1a68c3)
patchwork/api/check.py