diff --git a/api/funkwhale_api/federation/tasks.py b/api/funkwhale_api/federation/tasks.py index f6471ef21..75a3df937 100644 --- a/api/funkwhale_api/federation/tasks.py +++ b/api/funkwhale_api/federation/tasks.py @@ -190,7 +190,7 @@ def update_domain_nodeinfo(domain): now = timezone.now() try: nodeinfo = {"status": "ok", "payload": fetch_nodeinfo(domain.name)} - except (requests.RequestException, serializers.serializers.ValidationError) as e: + except (requests.RequestException, serializers.serializers.ValidationError, ValueError) as e: nodeinfo = {"status": "error", "error": str(e)} service_actor_id = common_utils.recursive_getattr( diff --git a/api/funkwhale_api/manage/views.py b/api/funkwhale_api/manage/views.py index 7dbbe578b..fb9ceabc5 100644 --- a/api/funkwhale_api/manage/views.py +++ b/api/funkwhale_api/manage/views.py @@ -371,7 +371,7 @@ class ManageDomainViewSet( def perform_create(self, serializer): domain = serializer.save() - federation_tasks.update_domain_nodeinfo.delay(domain_name=domain.name) + federation_tasks.update_domain_nodeinfo(domain_name=domain.name) @rest_decorators.action(methods=["get"], detail=True) def nodeinfo(self, request, *args, **kwargs): diff --git a/api/tests/manage/test_views.py b/api/tests/manage/test_views.py index 9a3c119ea..72394052c 100644 --- a/api/tests/manage/test_views.py +++ b/api/tests/manage/test_views.py @@ -63,7 +63,7 @@ def test_domain_detail(factories, superuser_api_client): def test_domain_create(superuser_api_client, mocker): update_domain_nodeinfo = mocker.patch( - "funkwhale_api.federation.tasks.update_domain_nodeinfo.delay" + "funkwhale_api.federation.tasks.update_domain_nodeinfo" ) url = reverse("api:v1:manage:federation:domains-list") response = superuser_api_client.post(url, {"name": "test.federation"})