server/tags: fix order of aliases in export

fixes #112
This commit is contained in:
rr- 2017-01-08 21:42:22 +01:00
parent a703195c6c
commit 8d8165a0d7
1 changed files with 4 additions and 1 deletions

View File

@ -104,7 +104,10 @@ def export_to_json():
'color': result[2],
}
for result in db.session.query(db.TagName.tag_id, db.TagName.name).all():
for result in (db.session
.query(db.TagName.tag_id, db.TagName.name)
.order_by(db.TagName.order)
.all()):
if not result[0] in tags:
tags[result[0]] = {'names': []}
tags[result[0]]['names'].append(result[1])