From b5cacb09e3a8e9f04bbf92d179f9c2c96ea05011 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 13 Nov 2022 19:03:43 -0700 Subject: Permit Mastodon's weird HTML through --- activities/models/post.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'activities/models') diff --git a/activities/models/post.py b/activities/models/post.py index d847307..74b335b 100644 --- a/activities/models/post.py +++ b/activities/models/post.py @@ -274,3 +274,18 @@ class Post(StatorModel): TimelineEvent.add_post(follow.source, post) # Force it into fanned_out as it's not ours post.transition_perform(PostStates.fanned_out) + + def debug_fetch(self): + """ + Fetches the Post from its original URL again and updates us with it + """ + response = httpx.get( + self.object_uri, + headers={"Accept": "application/json"}, + follow_redirects=True, + ) + if 200 <= response.status_code < 300: + return self.by_ap( + canonicalise(response.json(), include_security=True), + update=True, + ) -- cgit v1.2.3