Merge "Don't return links if subscriptions are empty"
This commit is contained in:
commit
1db24472df
@ -141,14 +141,17 @@ class CollectionResource(object):
|
|||||||
# Got some. Prepare the response.
|
# Got some. Prepare the response.
|
||||||
kwargs['marker'] = next(results) or kwargs.get('marker', '')
|
kwargs['marker'] = next(results) or kwargs.get('marker', '')
|
||||||
|
|
||||||
response_body = {
|
links = []
|
||||||
'subscriptions': subscriptions,
|
if results:
|
||||||
'links': [
|
links = [
|
||||||
{
|
{
|
||||||
'rel': 'next',
|
'rel': 'next',
|
||||||
'href': req.path + falcon.to_query_str(kwargs)
|
'href': req.path + falcon.to_query_str(kwargs)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
response_body = {
|
||||||
|
'subscriptions': subscriptions,
|
||||||
|
'links': links
|
||||||
}
|
}
|
||||||
|
|
||||||
resp.body = utils.to_json(response_body)
|
resp.body = utils.to_json(response_body)
|
||||||
|
Loading…
Reference in New Issue
Block a user