From fa07450da324f7399873dc75a0fbf52cb49b45f8 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Wed, 11 Jul 2018 22:52:20 +0200 Subject: [PATCH] Fix the build --- activitypub.py | 2 +- tasks.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/activitypub.py b/activitypub.py index 6c6372d..8deed50 100644 --- a/activitypub.py +++ b/activitypub.py @@ -95,7 +95,7 @@ class MicroblogPubBackend(Backend): } ) - tasks.cache_attachments(activity.id) + tasks.cache_attachments.delay(activity.id) if box == Box.INBOX: tasks.process_new_activity.delay(activity.id) diff --git a/tasks.py b/tasks.py index 79d2857..2787a0b 100644 --- a/tasks.py +++ b/tasks.py @@ -66,6 +66,7 @@ def cache_attachments(self, iri: str) -> None: if actor.icon: MEDIA_CACHE.cache(actor.icon["url"], Kind.ACTOR_ICON) + if activity.has_type(ap.ActivityType.CREATE): for attachment in activity.get_object()._data.get("attachment", []): MEDIA_CACHE.cache(attachment["url"], Kind.ATTACHMENT)