Let /tag/tagname.json only return the one main tag, not list.
Previously, the whole walk tree was returned. This can be convenient because you get the whole descendant tree all at once, but it's unusual since all the other individual .json endpoints only return a single object, not a list.
This commit is contained in:
parent
500f07283f
commit
84b4595454
1 changed files with 5 additions and 5 deletions
|
@ -146,13 +146,13 @@ def get_tags_json(specific_tag_name=None):
|
||||||
include_synonyms = request.args.get('synonyms')
|
include_synonyms = request.args.get('synonyms')
|
||||||
include_synonyms = include_synonyms is None or etiquette.helpers.truthystring(include_synonyms)
|
include_synonyms = include_synonyms is None or etiquette.helpers.truthystring(include_synonyms)
|
||||||
|
|
||||||
if specific_tag is None:
|
if specific_tag:
|
||||||
tags = list(common.P.get_tags())
|
response = specific_tag.jsonify(include_synonyms=include_synonyms)
|
||||||
else:
|
else:
|
||||||
tags = list(specific_tag.walk_children())
|
tags = list(common.P.get_tags())
|
||||||
|
response = [tag.jsonify(include_synonyms=include_synonyms) for tag in tags]
|
||||||
|
|
||||||
tags = [tag.jsonify(include_synonyms=include_synonyms) for tag in tags]
|
return jsonify.make_json_response(response)
|
||||||
return jsonify.make_json_response(tags)
|
|
||||||
|
|
||||||
# Tag create and delete ############################################################################
|
# Tag create and delete ############################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue