Incoming shelve activities
This commit is contained in:
@ -68,7 +68,10 @@ class ActivitypubMixin:
|
||||
if not hasattr(self, mapping.model_key) or not mapping.activity_key:
|
||||
continue
|
||||
value = getattr(self, mapping.model_key)
|
||||
if hasattr(value, 'remote_id'):
|
||||
print(value)
|
||||
if hasattr(value, 'local_id'):
|
||||
value = value.local_id
|
||||
elif hasattr(value, 'remote_id'):
|
||||
value = value.remote_id
|
||||
if isinstance(value, datetime):
|
||||
value = value.isoformat()
|
||||
|
@ -49,8 +49,8 @@ class ShelfBook(BookWyrmModel):
|
||||
return activitypub.Add(
|
||||
id='%s#add' % self.remote_id,
|
||||
actor=user.remote_id,
|
||||
object=self.book.to_activity(),
|
||||
target=self.shelf.to_activity()
|
||||
object=self.book.local_id,
|
||||
target=self.shelf.remote_id,
|
||||
).serialize()
|
||||
|
||||
def to_remove_activity(self, user):
|
||||
|
Reference in New Issue
Block a user