Fix not jsonifying the parent album.

master
voussoir 2017-05-13 15:44:03 -07:00
parent 4928095abb
commit c88654346b
1 changed files with 5 additions and 1 deletions

View File

@ -9,7 +9,11 @@ def album(a, minimal=False):
}
if not minimal:
j['photos'] = [photo(p) for p in a.photos()]
j['parent'] = a.parent()
parent = a.parent()
if parent is not None:
j['parent'] = album(parent, minimal=True)
else:
j['parent'] = None
j['sub_albums'] = [child.id for child in a.children()]
return j