mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 16:57:18 +02:00
Federation of avatars
This commit is contained in:
parent
b86971c305
commit
f107656586
20 changed files with 214 additions and 126 deletions
|
@ -18,20 +18,9 @@ from funkwhale_api.tags import serializers as tags_serializers
|
|||
from . import filters, models, tasks
|
||||
|
||||
|
||||
class NullToEmptDict(object):
|
||||
def get_attribute(self, o):
|
||||
attr = super().get_attribute(o)
|
||||
if attr is None:
|
||||
return {}
|
||||
return attr
|
||||
|
||||
def to_representation(self, v):
|
||||
if not v:
|
||||
return v
|
||||
return super().to_representation(v)
|
||||
|
||||
|
||||
class CoverField(NullToEmptDict, common_serializers.AttachmentSerializer):
|
||||
class CoverField(
|
||||
common_serializers.NullToEmptDict, common_serializers.AttachmentSerializer
|
||||
):
|
||||
# XXX: BACKWARD COMPATIBILITY
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue