merge-requests/552/head
Eliot Berriot 2018-12-27 20:39:03 +01:00
rodzic 91d99a0381
commit 942e9a15cb
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DD6965E2476E5C27
4 zmienionych plików z 6 dodań i 11 usunięć

Wyświetl plik

@ -114,8 +114,7 @@ class ActorSerializer(serializers.Serializer):
if maf is not None: if maf is not None:
kwargs["manually_approves_followers"] = maf kwargs["manually_approves_followers"] = maf
domain = urllib.parse.urlparse(kwargs["fid"]).netloc domain = urllib.parse.urlparse(kwargs["fid"]).netloc
kwargs["domain"] = models.Domain.objects.get_or_create( kwargs["domain"] = models.Domain.objects.get_or_create(pk=domain)[0]
pk=domain)[0]
for endpoint, url in self.initial_data.get("endpoints", {}).items(): for endpoint, url in self.initial_data.get("endpoints", {}).items():
if endpoint == "sharedInbox": if endpoint == "sharedInbox":
kwargs["shared_inbox_url"] = url kwargs["shared_inbox_url"] = url
@ -897,7 +896,4 @@ class NodeInfoLinkSerializer(serializers.Serializer):
class NodeInfoSerializer(serializers.Serializer): class NodeInfoSerializer(serializers.Serializer):
links = serializers.ListField( links = serializers.ListField(child=NodeInfoLinkSerializer(), min_length=1)
child=NodeInfoLinkSerializer(),
min_length=1
)

Wyświetl plik

@ -99,7 +99,7 @@ class ManageInvitationViewSet(
class ManageDomainViewSet( class ManageDomainViewSet(
mixins.ListModelMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet mixins.ListModelMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet
): ):
lookup_value_regex = "[a-zA-Z0-9\-\.]+" lookup_value_regex = r"[a-zA-Z0-9\-\.]+"
queryset = ( queryset = (
federation_models.Domain.objects.external() federation_models.Domain.objects.external()
.with_last_activity_date() .with_last_activity_date()

Wyświetl plik

@ -618,7 +618,8 @@ class UploadQuerySet(models.QuerySet):
return self.filter(import_status="finished", mimetype__startswith="audio/") return self.filter(import_status="finished", mimetype__startswith="audio/")
def with_file(self): def with_file(self):
return self.exclude(audio_file=None).exclude(audio_file='') return self.exclude(audio_file=None).exclude(audio_file="")
TRACK_FILE_IMPORT_STATUS_CHOICES = ( TRACK_FILE_IMPORT_STATUS_CHOICES = (
("pending", "Pending"), ("pending", "Pending"),

Wyświetl plik

@ -107,9 +107,7 @@ def test_domain_nodeinfo(factories, superuser_api_client, mocker):
def test_domain_stats(factories, superuser_api_client, mocker): def test_domain_stats(factories, superuser_api_client, mocker):
domain = factories["federation.Domain"]() domain = factories["federation.Domain"]()
get_stats = mocker.patch.object( mocker.patch.object(domain.__class__, "get_stats", return_value={"hello": "world"})
domain.__class__, "get_stats", return_value={"hello": "world"}
)
url = reverse("api:v1:manage:federation:domains-stats", kwargs={"pk": domain.name}) url = reverse("api:v1:manage:federation:domains-stats", kwargs={"pk": domain.name})
response = superuser_api_client.get(url) response = superuser_api_client.get(url)
assert response.status_code == 200 assert response.status_code == 200