Fixes default lists on activitypub dataclasses

This commit is contained in:
Mouse Reeve 2020-11-25 10:44:49 -08:00
parent 641ac22786
commit 9b57cfd331
4 changed files with 6 additions and 6 deletions

View file

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

View file

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

View file

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

View file

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