Verified Commit 942e9a15 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Linting

parent 91d99a03
......@@ -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
)
\ No newline at end of file
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
......
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