From 4e7a0d5734a67a4c7c048766d5e657ed2aed2980 Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Thu, 13 Oct 2022 19:49:12 +0200 Subject: [PATCH] fix(instance): Set default name to Funkwhale in SpaManifest --- api/funkwhale_api/instance/serializers.py | 1 + api/funkwhale_api/instance/views.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/funkwhale_api/instance/serializers.py b/api/funkwhale_api/instance/serializers.py index 9297b24f7..93fdd8d18 100644 --- a/api/funkwhale_api/instance/serializers.py +++ b/api/funkwhale_api/instance/serializers.py @@ -199,6 +199,7 @@ class NodeInfo20Serializer(serializers.Serializer): def get_metadata(self, obj): return MetadataSerializer(obj).data + class SpaManifestSerializer(serializers.Serializer): name = serializers.CharField() short_name = serializers.CharField() diff --git a/api/funkwhale_api/instance/views.py b/api/funkwhale_api/instance/views.py index b19f93186..91b3e3cb4 100644 --- a/api/funkwhale_api/instance/views.py +++ b/api/funkwhale_api/instance/views.py @@ -126,12 +126,13 @@ class SpaManifest(generics.GenericAPIView): serializer_class = serializers.SpaManifestSerializer @extend_schema(operation_id="get_spa_manifest") - def get(self, request, *args, **kwargs): + def get(self, request): existing_manifest = middleware.get_spa_file( settings.FUNKWHALE_SPA_HTML_ROOT, "manifest.json" ) parsed_manifest = json.loads(existing_manifest) parsed_manifest["short_name"] = settings.APP_NAME + parsed_manifest["name"] = settings.APP_NAME parsed_manifest["start_url"] = federation_utils.full_url("/") instance_name = preferences.get("instance__name") if instance_name: