Merge "Use util.validate_query_params in list_traits"
This commit is contained in:
commit
f177998841
@ -148,13 +148,7 @@ def list_traits(req):
|
|||||||
want_version = req.environ[microversion.MICROVERSION_ENVIRON]
|
want_version = req.environ[microversion.MICROVERSION_ENVIRON]
|
||||||
filters = {}
|
filters = {}
|
||||||
|
|
||||||
try:
|
util.validate_query_params(req, schema.LIST_TRAIT_SCHEMA)
|
||||||
jsonschema.validate(dict(req.GET), schema.LIST_TRAIT_SCHEMA,
|
|
||||||
format_checker=jsonschema.FormatChecker())
|
|
||||||
except jsonschema.ValidationError as exc:
|
|
||||||
raise webob.exc.HTTPBadRequest(
|
|
||||||
_('Invalid query string parameters: %(exc)s') %
|
|
||||||
{'exc': exc})
|
|
||||||
|
|
||||||
if 'name' in req.GET:
|
if 'name' in req.GET:
|
||||||
filters = _normalize_traits_qs_param(req.GET['name'])
|
filters = _normalize_traits_qs_param(req.GET['name'])
|
||||||
|
Loading…
Reference in New Issue
Block a user