Clearer syntax

This commit is contained in:
Mouse Reeve 2021-11-10 10:50:05 -08:00
parent 9815e9e100
commit d61595abb9

View file

@ -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