From c88654346b519a94c5ac553ad6695645482172d5 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 13 May 2017 15:44:03 -0700 Subject: [PATCH] Fix not jsonifying the parent album. --- etiquette/jsonify.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etiquette/jsonify.py b/etiquette/jsonify.py index a99b8a2..1cc714a 100644 --- a/etiquette/jsonify.py +++ b/etiquette/jsonify.py @@ -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