fix(instance): Set default name to Funkwhale in SpaManifest

environments/review-docs-api-d-ass8iq/deployments/14171
Georg Krause 2022-10-13 19:49:12 +02:00 zatwierdzone przez Georg Krause
rodzic 7ef652091c
commit 4e7a0d5734
2 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -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()

Wyświetl plik

@ -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: