forked from mirrors/bookwyrm
Fixes serialization of parent work remote_id
This commit is contained in:
parent
0c9dff61ca
commit
c5a215b11d
2 changed files with 7 additions and 3 deletions
|
@ -8,7 +8,7 @@ from .base_activity import ActivityObject
|
|||
class Like(ActivityObject):
|
||||
''' a user faving an object '''
|
||||
actor: str
|
||||
object: str
|
||||
object: ActivityObject
|
||||
type: str = 'Like'
|
||||
|
||||
|
||||
|
@ -16,5 +16,5 @@ class Like(ActivityObject):
|
|||
class Boost(ActivityObject):
|
||||
''' boosting a status '''
|
||||
actor: str
|
||||
object: str
|
||||
object: ActivityObject
|
||||
type: str = 'Announce'
|
||||
|
|
|
@ -67,6 +67,10 @@ class Book(ActivitypubMixin, BookWyrmModel):
|
|||
url='https://%s%s' % (DOMAIN, self.cover.url),
|
||||
)]
|
||||
|
||||
@property
|
||||
def ap_parent_work(self):
|
||||
''' reference the work via local id not remote '''
|
||||
return self.parent_work.local_id
|
||||
|
||||
activity_mappings = [
|
||||
ActivityMapping('id', 'remote_id'),
|
||||
|
@ -89,7 +93,7 @@ class Book(ActivitypubMixin, BookWyrmModel):
|
|||
ActivityMapping('librarything_key', 'librarything_key'),
|
||||
ActivityMapping('goodreads_key', 'goodreads_key'),
|
||||
|
||||
ActivityMapping('work', 'parent_work'),
|
||||
ActivityMapping('work', 'ap_parent_work'),
|
||||
ActivityMapping('isbn_10', 'isbn_10'),
|
||||
ActivityMapping('isbn_13', 'isbn_13'),
|
||||
ActivityMapping('oclc_number', 'oclc_number'),
|
||||
|
|
Loading…
Reference in a new issue