From db09ca43312fbbfafcda1d792db130cb358f2548 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 22 Apr 2021 07:51:06 -0700 Subject: [PATCH] Adds last edited by to author --- bookwyrm/activitypub/book.py | 1 + bookwyrm/models/activitypub_mixin.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bookwyrm/activitypub/book.py b/bookwyrm/activitypub/book.py index 538fa571..c5b896e3 100644 --- a/bookwyrm/activitypub/book.py +++ b/bookwyrm/activitypub/book.py @@ -65,6 +65,7 @@ class Author(ActivityObject): """ author of a book """ name: str + lastEditedBy: str = None born: str = None died: str = None aliases: List[str] = field(default_factory=lambda: []) diff --git a/bookwyrm/models/activitypub_mixin.py b/bookwyrm/models/activitypub_mixin.py index 71e02082..82a45ac8 100644 --- a/bookwyrm/models/activitypub_mixin.py +++ b/bookwyrm/models/activitypub_mixin.py @@ -153,9 +153,13 @@ class ActivitypubMixin: # unless it's a dm, all the followers should receive the activity if privacy != "direct": # we will send this out to a subset of all remote users - queryset = user_model.viewer_aware_objects(user).filter( - local=False, - ).distinct() + queryset = ( + user_model.viewer_aware_objects(user) + .filter( + local=False, + ) + .distinct() + ) # filter users first by whether they're using the desired software # this lets us send book updates only to other bw servers if software: