Fixes broken channel page
This commit is contained in:
parent
6057b4fe95
commit
ffd1ae0c44
12 changed files with 46 additions and 22 deletions
|
|
@ -267,7 +267,7 @@ class ChannelSerializer(serializers.ModelSerializer):
|
|||
return obj.actor.received_follows.exclude(approved=False).count()
|
||||
|
||||
def get_downloads_count(self, obj):
|
||||
return getattr(obj, "_downloads_count", None)
|
||||
return getattr(obj, "_downloads_count", None) or 0
|
||||
|
||||
def get_actor(self, obj):
|
||||
if obj.attributed_to == actors.get_service_actor():
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ def test_channel_serializer_external_representation(factories, to_api_date):
|
|||
"metadata": {},
|
||||
"rss_url": channel.get_rss_url(),
|
||||
"url": channel.actor.url,
|
||||
"downloads_count": None,
|
||||
"downloads_count": 0,
|
||||
}
|
||||
expected["artist"]["description"] = common_serializers.ContentSerializer(
|
||||
content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue