Replace image_serialzier helper with built-in serializers

This commit is contained in:
Mouse Reeve
2021-11-10 10:28:43 -08:00
parent d204e8dbb8
commit 4f5d23e785
3 changed files with 2 additions and 32 deletions

View File

@ -383,19 +383,6 @@ class CustomImageField(DjangoImageField):
widget = ClearableFileInputWithWarning
def image_serializer(value, alt):
"""helper for serializing images"""
if value and hasattr(value, "url"):
url = value.url
else:
return None
if url is not None:
url = url.lstrip("/")
url = urljoin(MEDIA_FULL_URL, url)
return activitypub.Document(url=url, name=alt)
class ImageField(ActivitypubFieldMixin, models.ImageField):
"""activitypub-aware image field"""