diff --git a/horizon/test/tests/templatetags.py b/horizon/test/tests/templatetags.py index e9c3f6791f..899d987144 100644 --- a/horizon/test/tests/templatetags.py +++ b/horizon/test/tests/templatetags.py @@ -43,8 +43,9 @@ class TemplateTagTests(test.TestCase): tag_call = "{%% %s %%}" % tag_name return self.render_template(tag_call, tag_require) - def render_template(self, template_text, tag_require='', context={}): + def render_template(self, template_text, tag_require='', context=None): """Render a Custom Template to string.""" + context = context or {} template = Template("{%% load %s %%} %s" % (tag_require, template_text)) return template.render(Context(context)) diff --git a/openstack_dashboard/api/glance.py b/openstack_dashboard/api/glance.py index 35ab7ab70c..7f21b31615 100644 --- a/openstack_dashboard/api/glance.py +++ b/openstack_dashboard/api/glance.py @@ -316,8 +316,9 @@ def metadefs_namespace_list(request, return namespaces, has_more_data, has_prev_data -def metadefs_namespace_full_list(request, resource_type, filters={}, +def metadefs_namespace_full_list(request, resource_type, filters=None, *args, **kwargs): + filters = filters or {} filters['resource_types'] = [resource_type] namespaces, has_more_data, has_prev_data = metadefs_namespace_list( request, filters, *args, **kwargs diff --git a/openstack_dashboard/api/rest/utils.py b/openstack_dashboard/api/rest/utils.py index b7d3dcdfbc..afe6e0b725 100644 --- a/openstack_dashboard/api/rest/utils.py +++ b/openstack_dashboard/api/rest/utils.py @@ -147,7 +147,7 @@ def ajax(authenticated=True, data_required=False, return decorator -def parse_filters_kwargs(request, client_keywords={}): +def parse_filters_kwargs(request, client_keywords=None): """Extract REST filter parameters from the request GET args. Client processes some keywords separately from filters and takes @@ -156,6 +156,7 @@ def parse_filters_kwargs(request, client_keywords={}): """ filters = {} kwargs = {} + client_keywords = client_keywords or {} for param in request.GET: if param in client_keywords: kwargs[param] = request.GET[param]