Removes last vestiges of PNG from the tests, code, docs and samples

This commit is contained in:
Trenton Holmes
2022-06-11 14:15:27 -07:00
parent cc4cea1a41
commit 1df517afd3
19 changed files with 14 additions and 60 deletions

View File

@@ -1,9 +1,7 @@
import textwrap
from pathlib import Path
from django.conf import settings
from django.core.checks import Error
from django.core.checks import Info
from django.core.checks import register
from django.core.exceptions import FieldError
from django.db.utils import OperationalError
@@ -68,23 +66,3 @@ def parser_check(app_configs, **kwargs):
]
else:
return []
@register()
def png_thumbnail_check(app_configs, **kwargs):
from documents.models import Document
try:
documents = Document.objects.all()
for document in documents:
existing_thumbnail = Path(document.thumbnail_path).resolve()
if existing_thumbnail.suffix == ".png":
return [
Info(
"PNG thumbnails found, consider running convert_thumbnails "
"to convert to WebP",
),
]
return []
except (OperationalError, ProgrammingError, FieldError):
return [] # No documents table yet