Fixed flaky test

This commit is contained in:
Eliot Berriot 2020-02-14 14:39:57 +01:00
parent 36c0065bb9
commit 27ada7845c
No known key found for this signature in database
GPG Key ID: 6B501DFD73514E14
1 changed files with 5 additions and 2 deletions

View File

@ -384,8 +384,7 @@ class ManageDomainViewSet(
): ):
lookup_value_regex = r"[a-zA-Z0-9\-\.]+" lookup_value_regex = r"[a-zA-Z0-9\-\.]+"
queryset = ( queryset = (
federation_models.Domain.objects.external() federation_models.Domain.objects.with_actors_count()
.with_actors_count()
.with_outbox_activities_count() .with_outbox_activities_count()
.prefetch_related("instance_policy") .prefetch_related("instance_policy")
.order_by("name") .order_by("name")
@ -402,6 +401,10 @@ class ManageDomainViewSet(
"instance_policy", "instance_policy",
] ]
def get_queryset(self, **kwargs):
queryset = super().get_queryset(**kwargs)
return queryset.external()
def get_serializer_class(self): def get_serializer_class(self):
if self.action in ["update", "partial_update"]: if self.action in ["update", "partial_update"]:
# A dedicated serializer for update # A dedicated serializer for update