From fcf9524ac090f4594177457ca16dbcfe8e8f4daf Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 22 Jul 2018 12:53:09 +0200 Subject: [PATCH] Tweaks --- tasks.py | 3 ++- templates/utils.html | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index 5793e8b..d7f5f05 100644 --- a/tasks.py +++ b/tasks.py @@ -117,7 +117,8 @@ def process_new_activity(self, iri: str) -> None: ) log.info(f"new activity {iri} processed") - cache_actor.delay(iri) + if not should_delete: + cache_actor.delay(iri) except (ActivityGoneError, ActivityNotFoundError): log.exception(f"dropping activity {iri}, skip processing") except Exception as err: diff --git a/templates/utils.html b/templates/utils.html index c3b586e..c428fe6 100644 --- a/templates/utils.html +++ b/templates/utils.html @@ -1,4 +1,5 @@ {% macro display_actor_inline(follower, size=50) -%} +{% if follower and follower.id %} {% if not follower.icon %} @@ -11,6 +12,7 @@ @{{ follower.preferredUsername }}@{{ follower | url_or_id | get_url | domain }} +{% endif %} {%- endmacro %}