From 66094201154dbdb09782e78f15840c8aeade4fc6 Mon Sep 17 00:00:00 2001 From: Timur Sufiev Date: Mon, 19 Sep 2016 13:56:18 +0300 Subject: [PATCH] Fix getting the images list in Admin->Images Do this by converting 'None' / 'True' / 'False' to their Python counterparts. Change-Id: Ifd17f4587759e7a67218278d28ee77fc9b80530a Closes-Bug: #1624700 --- openstack_dashboard/api/rest/utils.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/openstack_dashboard/api/rest/utils.py b/openstack_dashboard/api/rest/utils.py index 0c18799ff1..2ac668800b 100644 --- a/openstack_dashboard/api/rest/utils.py +++ b/openstack_dashboard/api/rest/utils.py @@ -146,6 +146,12 @@ def ajax(authenticated=True, data_required=False, return _wrapped return decorator +PARAM_MAPPING = { + 'None': None, + 'True': True, + 'False': False +} + def parse_filters_kwargs(request, client_keywords=None): """Extract REST filter parameters from the request GET args. @@ -158,10 +164,11 @@ def parse_filters_kwargs(request, client_keywords=None): kwargs = {} client_keywords = client_keywords or {} for param in request.GET: + param_value = PARAM_MAPPING.get(request.GET[param], request.GET[param]) if param in client_keywords: - kwargs[param] = request.GET[param] + kwargs[param] = param_value else: - filters[param] = request.GET[param] + filters[param] = param_value return filters, kwargs