From 930aab384e109bffde4ff482f04d6d34ae89077b Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Fri, 5 May 2023 23:30:59 -0700 Subject: [PATCH] Debug, search fixes --- activities/services/search.py | 4 +++- activities/views/debug.py | 3 ++- templates/activities/debug_json.html | 5 +---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/activities/services/search.py b/activities/services/search.py index b8dcae6..bb01eb6 100644 --- a/activities/services/search.py +++ b/activities/services/search.py @@ -127,7 +127,9 @@ class SearchService: """ Searches for posts on an identity via full text search """ - return self.identity.posts.filter(content__search=self.query)[:50] + return self.identity.posts.unlisted(include_replies=True).filter( + content__search=self.query + )[:50] def search_all(self): """ diff --git a/activities/views/debug.py b/activities/views/debug.py index d93190e..9cb4393 100644 --- a/activities/views/debug.py +++ b/activities/views/debug.py @@ -56,7 +56,8 @@ class JsonViewer(FormView): except json.JSONDecodeError as ex: result = str(ex) else: - result = json.dumps(document, indent=4, sort_keys=True) + context["raw_result"] = json.dumps(response.json(), indent=2) + result = json.dumps(document, indent=2, sort_keys=True) # result = pprint.pformat(document) context["result"] = result return self.render_to_response(context) diff --git a/templates/activities/debug_json.html b/templates/activities/debug_json.html index 387ed13..18ded5e 100644 --- a/templates/activities/debug_json.html +++ b/templates/activities/debug_json.html @@ -56,10 +56,7 @@ else set my.innerText to 'Hide' ">Show - +
Canonical: