From 53e5a9e23714f15fc4ebcbc18c0e88beaccb3ca2 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Wed, 1 Aug 2018 08:29:08 +0200 Subject: [PATCH] Add debug logs --- app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app.py b/app.py index 221bcf6..9a31af0 100644 --- a/app.py +++ b/app.py @@ -939,6 +939,7 @@ def note_by_id(note_id): if data["meta"].get("deleted", False): abort(410) thread = _build_thread(data) + app.logger.info(f"thread={thread!r}") likes = list( DB.activities.find( @@ -947,6 +948,7 @@ def note_by_id(note_id): "meta.deleted": False, "type": ActivityType.LIKE.value, "$or": [ + # FIXME(tsileo): remove all the useless $or {"activity.object.id": data["activity"]["object"]["id"]}, {"activity.object": data["activity"]["object"]["id"]}, ], @@ -954,6 +956,7 @@ def note_by_id(note_id): ) ) likes = [doc["meta"]["actor"] for doc in likes] + app.logger.info(f"likes={likes!r}") shares = list( DB.activities.find( @@ -969,6 +972,7 @@ def note_by_id(note_id): ) ) shares = [doc["meta"]["actor"] for doc in shares] + app.logger.info(f"shares={shares!r}") return render_template( "note.html", likes=likes, shares=shares, thread=thread, note=data