Merge "Remove arguments "{}" in function definitions"

This commit is contained in:
Jenkins 2015-12-17 05:12:35 +00:00 committed by Gerrit Code Review
commit b43efaba7a
3 changed files with 6 additions and 3 deletions

View File

@ -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))

View File

@ -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

View File

@ -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]