Automatically handle image fields in model serializer
This commit is contained in:
parent
4ae785a7f7
commit
2480690378
4 changed files with 11 additions and 25 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue