diff --git a/fedireads/models/shelf.py b/fedireads/models/shelf.py index 993c7b7a..a87a19cb 100644 --- a/fedireads/models/shelf.py +++ b/fedireads/models/shelf.py @@ -24,10 +24,6 @@ class Shelf(FedireadsModel): model_name = type(self).__name__.lower() return '%s/%s/%s' % (base_path, model_name, self.identifier) - @property - def activitypub_serialize(self): - return activitypub.get_shelf(self) - class Meta: unique_together = ('user', 'identifier') diff --git a/fedireads/models/user.py b/fedireads/models/user.py index 2f2c3dab..13fa8245 100644 --- a/fedireads/models/user.py +++ b/fedireads/models/user.py @@ -73,6 +73,10 @@ class User(AbstractUser): username = self.localname or self.username return 'https://%s/%s/%s' % (DOMAIN, model_name, username) + @property + def activitypub_serialize(self): + return activitypub.get_actor(self) + class UserRelationship(FedireadsModel): ''' many-to-many through table for followers ''' diff --git a/fedireads/views.py b/fedireads/views.py index 6cb1dbe4..09f544bb 100644 --- a/fedireads/views.py +++ b/fedireads/views.py @@ -239,7 +239,7 @@ def user_page(request, username, subpage=None): if is_api_request(request): # we have a json request - return JsonResponse(activitypub.get_actor(user)) + return JsonResponse(user.activitypub_serialize) # otherwise we're at a UI view # TODO: change display with privacy and authentication considerations