diff --git a/bookwyrm/activitypub/book.py b/bookwyrm/activitypub/book.py index 60d36bd0..bdc30edd 100644 --- a/bookwyrm/activitypub/book.py +++ b/bookwyrm/activitypub/book.py @@ -25,7 +25,7 @@ class Book(ActivityObject): librarything_key: str goodreads_key: str - attachment: List[Image] = field(default=lambda: []) + attachment: List[Image] = field(default_factory=lambda: []) type: str = 'Book' diff --git a/bookwyrm/activitypub/note.py b/bookwyrm/activitypub/note.py index ebc0cf3c..9eab952d 100644 --- a/bookwyrm/activitypub/note.py +++ b/bookwyrm/activitypub/note.py @@ -24,8 +24,8 @@ class Note(ActivityObject): cc: List[str] content: str replies: Dict - tag: List[Link] = field(default=lambda: []) - attachment: List[Image] = field(default=lambda: []) + tag: List[Link] = field(default_factory=lambda: []) + attachment: List[Image] = field(default_factory=lambda: []) sensitive: bool = False type: str = 'Note' diff --git a/bookwyrm/activitypub/person.py b/bookwyrm/activitypub/person.py index 118774a2..324d68e3 100644 --- a/bookwyrm/activitypub/person.py +++ b/bookwyrm/activitypub/person.py @@ -15,7 +15,7 @@ class Person(ActivityObject): summary: str publicKey: PublicKey endpoints: Dict - icon: Image = field(default=lambda: {}) + icon: Image = field(default_factory=lambda: {}) bookwyrmUser: bool = False manuallyApprovesFollowers: str = False discoverable: str = True diff --git a/bookwyrm/tests/data/ap_quotation.json b/bookwyrm/tests/data/ap_quotation.json index 5085547a..089bc85f 100644 --- a/bookwyrm/tests/data/ap_quotation.json +++ b/bookwyrm/tests/data/ap_quotation.json @@ -19,8 +19,8 @@ "mediaType": "image//images/covers/2b4e4712-5a4d-4ac1-9df4-634cc9c7aff3jpg", "url": "https://example.com/images/covers/2b4e4712-5a4d-4ac1-9df4-634cc9c7aff3jpg", "name": "Cover of \"This Is How You Lose the Time War\"" - } - ], + } + ], "replies": { "id": "https://example.com/user/mouse/quotation/13/replies", "type": "Collection",