Update forms.py

This commit is contained in:
Mouse Reeve 2022-02-04 11:47:18 -08:00 committed by GitHub
parent 495af09c4c
commit 82aacf8f2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -238,6 +238,7 @@ class FileLinkForm(CustomForm):
if models.LinkDomain.objects.filter(domain=domain).exists(): if models.LinkDomain.objects.filter(domain=domain).exists():
status = models.LinkDomain.objects.get(domain=domain).status status = models.LinkDomain.objects.get(domain=domain).status
if status == "blocked": if status == "blocked":
# pylint: disable=line-too-long
self.add_error( self.add_error(
"url", "url",
_( _(
@ -247,6 +248,7 @@ class FileLinkForm(CustomForm):
elif models.FileLink.objects.filter( elif models.FileLink.objects.filter(
url=url, book=book, filetype=filetype url=url, book=book, filetype=filetype
).exists(): ).exists():
# pylint: disable=line-too-long
self.add_error( self.add_error(
"url", "url",
_( _(