forked from mirrors/bookwyrm
Don't use generic ActivityObject as serializer
This commit is contained in:
parent
8bb20730fc
commit
b18dac5814
2 changed files with 6 additions and 1 deletions
|
@ -76,8 +76,12 @@ class ActivityObject:
|
|||
is_subclass = False
|
||||
# parse a dict into the appropriate activity
|
||||
if is_subclass and isinstance(value, dict):
|
||||
serializer = None
|
||||
if not isinstance(field.type, ActivityObject):
|
||||
# this is generic, gotta figure out the type manually
|
||||
serializer = field.type
|
||||
value = naive_parse(
|
||||
activity_objects, value, serializer=field.type)
|
||||
activity_objects, value, serializer=serializer)
|
||||
|
||||
except KeyError:
|
||||
if field.default == MISSING and \
|
||||
|
|
|
@ -17,6 +17,7 @@ class OrderedCollection(ActivityObject):
|
|||
|
||||
@dataclass(init=False)
|
||||
class OrderedCollectionPrivate(OrderedCollection):
|
||||
''' an ordered collection with privacy settings '''
|
||||
to: List[str] = field(default_factory=lambda: [])
|
||||
cc: List[str] = field(default_factory=lambda: [])
|
||||
|
||||
|
|
Loading…
Reference in a new issue