Fixes image federation

This commit is contained in:
Mouse Reeve 2021-08-02 18:55:08 -07:00
parent 2beaa0f0b7
commit 8ef1d0d3ac

View file

@ -11,8 +11,10 @@ from django.core.exceptions import ValidationError
from django.core.files.base import ContentFile from django.core.files.base import ContentFile
from django.db import models from django.db import models
from django.forms import ClearableFileInput, ImageField as DjangoImageField from django.forms import ClearableFileInput, ImageField as DjangoImageField
from django.templatetags.static import static
from django.utils import timezone from django.utils import timezone
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from bookwyrm import activitypub from bookwyrm import activitypub
from bookwyrm.connectors import get_image from bookwyrm.connectors import get_image
from bookwyrm.sanitize_html import InputHtmlParser from bookwyrm.sanitize_html import InputHtmlParser
@ -354,7 +356,7 @@ def image_serializer(value, alt):
url = value.url url = value.url
else: else:
return None return None
url = "https://%s%s" % (DOMAIN, url) url = static(url)
return activitypub.Document(url=url, name=alt) return activitypub.Document(url=url, name=alt)