Python formatting

This commit is contained in:
Mouse Reeve 2022-01-10 11:21:03 -08:00
parent f0ae37c331
commit 4820a2f982
2 changed files with 10 additions and 6 deletions

View file

@ -16,7 +16,11 @@ class Link(ActivitypubMixin, BookWyrmModel):
url = fields.URLField(max_length=255, activitypub_field="href")
domain = models.ForeignKey(
"LinkDomain", on_delete=models.CASCADE, null=True, blank=True, related_name="links"
"LinkDomain",
on_delete=models.CASCADE,
null=True,
blank=True,
related_name="links",
)
activity_serializer = activitypub.Link

View file

@ -20,9 +20,9 @@ class LinkDomain(View):
def get(self, request, status):
"""view pending domains"""
data = {
"domains": models.LinkDomain.objects.filter(
status=status
).prefetch_related("links"),
"domains": models.LinkDomain.objects.filter(status=status).prefetch_related(
"links"
),
"form": forms.EmailBlocklistForm(),
"status": status,
}
@ -35,7 +35,7 @@ class LinkDomain(View):
domain = get_object_or_404(models.LinkDomain, id=domain_id)
form = forms.LinkDomainForm(request.POST, instance=domain)
form.save()
return redirect('settings-link-domain', status=status)
return redirect("settings-link-domain", status=status)
@require_POST
@ -47,4 +47,4 @@ def update_domain_status(request, domain_id, status):
domain.status = status
domain.save()
return redirect('settings-link-domain', status="pending")
return redirect("settings-link-domain", status="pending")