From 029e42524ed4e4b6e32e67d17e11ffb9695d16f9 Mon Sep 17 00:00:00 2001 From: Chaiwat Suttipongsakul Date: Tue, 12 Feb 2019 20:44:56 +0700 Subject: [PATCH] fix 500 when remote follow --- app.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app.py b/app.py index 4459267..0730813 100644 --- a/app.py +++ b/app.py @@ -1895,12 +1895,8 @@ def followers(): ) raw_followers, older_than, newer_than = paginated_query(DB.activities, q) - followers = [] - for doc in raw_followers: - try: - followers.append(doc["meta"]["actor"]) - except Exception: - pass + followers = [doc["meta"]["actor"] + for doc in raw_followers if "actor" in doc.get("meta", {})] return render_template( "followers.html", followers_data=followers, @@ -1928,7 +1924,9 @@ def following(): abort(404) following, older_than, newer_than = paginated_query(DB.activities, q) - following = [(doc["remote_id"], doc["meta"]["object"]) for doc in following] + following = [(doc["remote_id"], doc["meta"]["object"]) + for doc in following + if "remote_id" in doc and "object" in doc.get("meta", {})] return render_template( "following.html", following_data=following,