diff --git a/activitypub.py b/activitypub.py index 1a6a9fe..aeac7e9 100644 --- a/activitypub.py +++ b/activitypub.py @@ -10,9 +10,9 @@ from typing import Optional from bson.objectid import ObjectId from feedgen.feed import FeedGenerator from html2text import html2text -from cachetools import LRUCache import tasks +from cachetools import LRUCache from config import BASE_URL from config import DB from config import EXTRA_INBOXES @@ -181,8 +181,8 @@ class MicroblogPubBackend(Backend): data = DB.actors.find_one({"remote_id": iri}) if data: - ACTORS_CACHE[iri] = data['data'] - return data['data'] + ACTORS_CACHE[iri] = data["data"] + return data["data"] data = self._fetch_iri(iri) if ap._has_type(data["type"], ap.ACTOR_TYPES): diff --git a/app.py b/app.py index e4f4995..0287efc 100644 --- a/app.py +++ b/app.py @@ -1569,7 +1569,7 @@ def following(): ) following, older_than, newer_than = paginated_query(DB.activities, q) - following = [get_backend.fetch_iri(doc["activity"]["object"]) for doc in following] + following = [get_backend().fetch_iri(doc["activity"]["object"]) for doc in following] return render_template( "following.html", following_data=following,