Fixes image attachments
This commit is contained in:
@ -445,7 +445,11 @@ def unfurl_related_field(related_field, sort_field=None):
|
||||
unfurl_related_field(i) for i in related_field.order_by(sort_field).all()
|
||||
]
|
||||
if related_field.reverse_unfurl:
|
||||
return related_field.field_to_activity()
|
||||
# if it's a one-to-one (key pair)
|
||||
if hasattr(related_field, "field_to_activity"):
|
||||
return related_field.field_to_activity()
|
||||
# if it's one-to-many (attachments)
|
||||
return related_field.to_activity()
|
||||
return related_field.remote_id
|
||||
|
||||
|
||||
|
@ -25,7 +25,11 @@ class Image(Attachment):
|
||||
""" an image attachment """
|
||||
|
||||
image = fields.ImageField(
|
||||
upload_to="status/", null=True, blank=True, activitypub_field="url"
|
||||
upload_to="status/",
|
||||
null=True,
|
||||
blank=True,
|
||||
activitypub_field="url",
|
||||
alt_field="caption",
|
||||
)
|
||||
caption = fields.TextField(null=True, blank=True, activitypub_field="name")
|
||||
|
||||
|
Reference in New Issue
Block a user