From d61595abb9df3c816a60f60332aa07a3fbdadde8 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 10 Nov 2021 10:50:05 -0800 Subject: [PATCH] Clearer syntax --- bookwyrm/models/status.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index 767841c8..d3fcc254 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -189,10 +189,9 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel): if hasattr(activity, "name"): activity.name = self.pure_name activity.type = self.pure_type + books = [getattr(self, "book", None)] + list(self.mention_books.all()) covers = [ - b.to_activity().get("cover") - for b in [getattr(self, "book", None)] + list(self.mention_books.all()) - if b + b.to_activity().get("cover") for b in books if b ] activity.attachment = covers return activity