Verified Commit 703d70d5 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Use absolute urls

parent 0c8faf83
......@@ -6,6 +6,7 @@ from django.conf import settings
from dynamic_preferences.registries import global_preferences_registry
from . import models
from . import utils
def get_actor_data(actor_url):
......@@ -29,18 +30,22 @@ def get_base_system_actor_arguments(name):
'type': 'Person',
'name': '{}\'s library'.format(settings.FEDERATION_HOSTNAME),
'manually_approves_followers': True,
'url': reverse(
'url': utils.full_url(
reverse(
'federation:instance-actors-detail',
kwargs={'actor': name}),
'shared_inbox_url': reverse(
kwargs={'actor': name})),
'shared_inbox_url': utils.full_url(
reverse(
'federation:instance-actors-inbox',
kwargs={'actor': name}),
'inbox_url': reverse(
kwargs={'actor': name})),
'inbox_url': utils.full_url(
reverse(
'federation:instance-actors-inbox',
kwargs={'actor': name}),
'outbox_url': reverse(
kwargs={'actor': name})),
'outbox_url': utils.full_url(
reverse(
'federation:instance-actors-outbox',
kwargs={'actor': name}),
kwargs={'actor': name})),
'public_key': preferences['federation__public_key'],
'summary': 'Bot account to federate with {}\'s library'.format(
settings.FEDERATION_HOSTNAME
......
from django.urls import reverse
from funkwhale_api.federation import actors
from funkwhale_api.federation import utils
def test_actor_fetching(r_mock):
......@@ -24,15 +25,18 @@ def test_get_library(settings, preferences):
'type': 'Person',
'name': '{}\'s library'.format(settings.FEDERATION_HOSTNAME),
'manually_approves_followers': True,
'url': reverse(
'url': utils.full_url(
reverse(
'federation:instance-actors-detail',
kwargs={'actor': 'library'}),
'shared_inbox_url': reverse(
kwargs={'actor': 'library'})),
'shared_inbox_url': utils.full_url(
reverse(
'federation:instance-actors-inbox',
kwargs={'actor': 'library'}),
'inbox_url': reverse(
kwargs={'actor': 'library'})),
'inbox_url': utils.full_url(
reverse(
'federation:instance-actors-inbox',
kwargs={'actor': 'library'}),
kwargs={'actor': 'library'})),
'public_key': 'public_key',
'summary': 'Bot account to federate with {}\'s library'.format(
settings.FEDERATION_HOSTNAME),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment