mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-22 17:41:08 +00:00
Merge branch 'image-serialize' into user-export
pulls Mouse's fix for imagefile serialization
This commit is contained in:
commit
582e97e4a5
3 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
""" actor serializer """
|
||||
from dataclasses import dataclass, field
|
||||
from dataclasses import dataclass
|
||||
from typing import Dict
|
||||
|
||||
from .base_activity import ActivityObject
|
||||
|
@ -35,7 +35,7 @@ class Person(ActivityObject):
|
|||
endpoints: Dict = None
|
||||
name: str = None
|
||||
summary: str = None
|
||||
icon: Image = field(default_factory=lambda: {})
|
||||
icon: Image = None
|
||||
bookwyrmUser: bool = False
|
||||
manuallyApprovesFollowers: str = False
|
||||
discoverable: str = False
|
||||
|
|
|
@ -482,7 +482,7 @@ class ImageField(ActivitypubFieldMixin, models.ImageField):
|
|||
if not url:
|
||||
return None
|
||||
|
||||
return activitypub.Document(url=url, name=alt)
|
||||
return activitypub.Image(url=url, name=alt)
|
||||
|
||||
def field_from_activity(self, value, allow_external_connections=True):
|
||||
image_slug = value
|
||||
|
|
|
@ -438,7 +438,7 @@ class ModelFields(TestCase):
|
|||
)
|
||||
)
|
||||
self.assertEqual(output.name, "")
|
||||
self.assertEqual(output.type, "Document")
|
||||
self.assertEqual(output.type, "Image")
|
||||
|
||||
@responses.activate
|
||||
def test_image_field_from_activity(self, *_):
|
||||
|
|
Loading…
Reference in a new issue