From 827d453d7a2e7301da3cabbc34307a765ef3726d Mon Sep 17 00:00:00 2001 From: Stanislav Dmitriev Date: Thu, 5 Jan 2023 15:28:46 -0500 Subject: [PATCH] Fix Image Filter for images with None names Replacing None with empty string to fix non_api_filters processing if resources have None attributes Closes-Bug: #2002027 Change-Id: I57493837cede7747bbb634959ace28b2feffb543 --- openstack_dashboard/dashboards/project/instances/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openstack_dashboard/dashboards/project/instances/views.py b/openstack_dashboard/dashboards/project/instances/views.py index c1c3ae4329..badf540b83 100644 --- a/openstack_dashboard/dashboards/project/instances/views.py +++ b/openstack_dashboard/dashboards/project/instances/views.py @@ -253,7 +253,8 @@ def _swap_filter(resources, search_opts, fake_field, real_field): return True filter_string = search_opts[fake_field] matched = [resource for resource in resources - if resource.name.lower() == filter_string.lower()] + if (resource.name is not None and + resource.name.lower() == filter_string.lower())] if not matched: return False search_opts[real_field] = matched[0].id