Automatically handle image fields in model serializer

This commit is contained in:
Mouse Reeve
2020-11-27 18:26:07 -08:00
parent 4ae785a7f7
commit 2480690378
4 changed files with 11 additions and 25 deletions

View File

@ -112,11 +112,7 @@ class User(OrderedCollectionPageMixin, AbstractUser):
activity_formatter=lambda x: {'sharedInbox': x},
model_formatter=lambda x: x.get('sharedInbox')
),
ActivityMapping(
'icon', 'avatar',
lambda x: image_formatter(x, '/static/images/default_avi.jpg'),
activitypub.image_formatter
),
ActivityMapping('icon', 'avatar'),
ActivityMapping(
'manuallyApprovesFollowers',
'manually_approves_followers'