Fix tests

This commit is contained in:
Joachim
2021-08-04 19:11:57 +02:00
parent bc7710a4a7
commit c6f8236b07
2 changed files with 9 additions and 10 deletions

View File

@ -387,7 +387,8 @@ class ImageField(ActivitypubFieldMixin, models.ImageField):
activity[key] = formatted
def field_to_activity(self, value, alt=None):
return image_serializer(value, alt)
url = self.get_absolute_url(value)
return activitypub.Document(url=url, name=alt)
def field_from_activity(self, value):
image_slug = value
@ -425,7 +426,7 @@ class ImageField(ActivitypubFieldMixin, models.ImageField):
def get_absolute_url(self, value):
"""returns an absolute URL for the image"""
name = getattr(value, self.name)
name = getattr(value, "name")
if name is None:
return None