Don't double-override to_activity

This commit is contained in:
Mouse Reeve 2021-04-17 13:31:37 -07:00
parent ebdbdc8790
commit 44528eaa09

View file

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