Fixes deserializing tags of varied types

This commit is contained in:
Mouse Reeve
2020-12-07 13:16:42 -08:00
parent 6817babf3c
commit 0a576c325c
2 changed files with 34 additions and 6 deletions

View File

@ -182,6 +182,10 @@ class TagField(ManyToManyField):
items = []
for link_json in value:
link = activitypub.Link(**link_json)
tag_type = link.type if link.type != 'Mention' else 'Person'
if tag_type != self.related_model.activity_serializer.type:
# tags can contain multiple types
continue
items.append(
activitypub.resolve_remote_id(self.related_model, link.href)
)