Merge "Don't return links if subscriptions are empty"

This commit is contained in:
Jenkins 2016-02-10 14:52:36 +00:00 committed by Gerrit Code Review
commit 1db24472df

View File

@ -141,14 +141,17 @@ class CollectionResource(object):
# Got some. Prepare the response.
kwargs['marker'] = next(results) or kwargs.get('marker', '')
response_body = {
'subscriptions': subscriptions,
'links': [
links = []
if results:
links = [
{
'rel': 'next',
'href': req.path + falcon.to_query_str(kwargs)
}
]
response_body = {
'subscriptions': subscriptions,
'links': links
}
resp.body = utils.to_json(response_body)