]> git.ipfire.org Git - thirdparty/patchwork.git/commit
REST: Resolve issues with filters
authorStephen Finucane <stephen@that.guru>
Mon, 15 May 2017 23:13:37 +0000 (00:13 +0100)
committerStephen Finucane <stephen@that.guru>
Thu, 18 May 2017 20:19:14 +0000 (21:19 +0100)
commit932abc2c662624a3b1456e1d6e30358e05dbfbea
tree0cae2512feb8a5e3f74ccd426a23bb95dc86a752
parente27b68a1cc113310535f0fadd7a56a5a54cc2b25
REST: Resolve issues with filters

Turns out filtering patches using a series string wasn't as easy as we
thought. We need to slugify State.name, but unfortunately that isn't
stored in the database. The tests were hiding this fact as State objects
created by 'tests.utils.create_state' don't have spaces in them.

Override custom versions of both django-filter's 'Filter' class and
the Django 'Form' required by this, and update the tests to prevent a
regression.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: 6222574 ("REST: filter patches by state name")
Tested-by: Philippe Pepiot <philippe.pepiot@logilab.fr>
patchwork/api/filters.py
patchwork/api/patch.py
patchwork/models.py
patchwork/tests/test_rest_api.py