From 44528eaa09057d1d53e1177e03b563b2cb135799 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 17 Apr 2021 13:31:37 -0700 Subject: [PATCH] Don't double-override to_activity --- bookwyrm/models/user.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index b26b3b00..9585a4c4 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -205,6 +205,9 @@ class User(OrderedCollectionPageMixin, AbstractUser): def to_activity(self, **kwargs): """override default AP serializer to add context object idk if this is the best way to go about this""" + if not self.is_active: + return self.remote_id + activity_object = super().to_activity(**kwargs) activity_object["@context"] = [ "https://www.w3.org/ns/activitystreams", @@ -289,12 +292,6 @@ class User(OrderedCollectionPageMixin, AbstractUser): # skip the logic in this class's save() super().save(*args, **kwargs) - def to_activity(self, *args, **kwargs): - """ return a remote_id only if the user is inactive """ - if not self.is_active: - return self.remote_id - return super().to_activity_dataclass(*args, **kwargs) - @property def local_path(self): """ this model doesn't inherit bookwyrm model, so here we are """