kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
Linting
rodzic
91d99a0381
commit
942e9a15cb
|
@ -114,8 +114,7 @@ class ActorSerializer(serializers.Serializer):
|
|||
if maf is not None:
|
||||
kwargs["manually_approves_followers"] = maf
|
||||
domain = urllib.parse.urlparse(kwargs["fid"]).netloc
|
||||
kwargs["domain"] = models.Domain.objects.get_or_create(
|
||||
pk=domain)[0]
|
||||
kwargs["domain"] = models.Domain.objects.get_or_create(pk=domain)[0]
|
||||
for endpoint, url in self.initial_data.get("endpoints", {}).items():
|
||||
if endpoint == "sharedInbox":
|
||||
kwargs["shared_inbox_url"] = url
|
||||
|
@ -897,7 +896,4 @@ class NodeInfoLinkSerializer(serializers.Serializer):
|
|||
|
||||
|
||||
class NodeInfoSerializer(serializers.Serializer):
|
||||
links = serializers.ListField(
|
||||
child=NodeInfoLinkSerializer(),
|
||||
min_length=1
|
||||
)
|
||||
links = serializers.ListField(child=NodeInfoLinkSerializer(), min_length=1)
|
||||
|
|
|
@ -99,7 +99,7 @@ class ManageInvitationViewSet(
|
|||
class ManageDomainViewSet(
|
||||
mixins.ListModelMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet
|
||||
):
|
||||
lookup_value_regex = "[a-zA-Z0-9\-\.]+"
|
||||
lookup_value_regex = r"[a-zA-Z0-9\-\.]+"
|
||||
queryset = (
|
||||
federation_models.Domain.objects.external()
|
||||
.with_last_activity_date()
|
||||
|
|
|
@ -618,7 +618,8 @@ class UploadQuerySet(models.QuerySet):
|
|||
return self.filter(import_status="finished", mimetype__startswith="audio/")
|
||||
|
||||
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 = (
|
||||
("pending", "Pending"),
|
||||
|
|
|
@ -107,9 +107,7 @@ def test_domain_nodeinfo(factories, superuser_api_client, mocker):
|
|||
|
||||
def test_domain_stats(factories, superuser_api_client, mocker):
|
||||
domain = factories["federation.Domain"]()
|
||||
get_stats = mocker.patch.object(
|
||||
domain.__class__, "get_stats", return_value={"hello": "world"}
|
||||
)
|
||||
mocker.patch.object(domain.__class__, "get_stats", return_value={"hello": "world"})
|
||||
url = reverse("api:v1:manage:federation:domains-stats", kwargs={"pk": domain.name})
|
||||
response = superuser_api_client.get(url)
|
||||
assert response.status_code == 200
|
||||
|
|
Ładowanie…
Reference in New Issue