Use django-file-resubmit plugin

- save cover images to cache when checking author and work for existing records
- fixes #2760
This commit is contained in:
Hugh Rundle 2023-10-30 19:43:39 +11:00
parent c9e6dcc2d9
commit df43a8e2c5
No known key found for this signature in database
GPG key ID: A7E35779918253F9
3 changed files with 9 additions and 4 deletions

View file

@ -3,6 +3,7 @@ from django import forms
from bookwyrm import models
from bookwyrm.models.fields import ClearableFileInputWithWarning
from file_resubmit.admin import AdminResubmitImageWidget
from .custom_form import CustomForm
from .widgets import ArrayWidget, SelectDateWidget, Select
@ -70,9 +71,7 @@ class EditionForm(CustomForm):
"published_date": SelectDateWidget(
attrs={"aria-describedby": "desc_published_date"}
),
"cover": ClearableFileInputWithWarning(
attrs={"aria-describedby": "desc_cover"}
),
"cover": AdminResubmitImageWidget(attrs={"aria-describedby": "desc_cover"}),
"physical_format": Select(
attrs={"aria-describedby": "desc_physical_format"}
),

View file

@ -99,6 +99,7 @@ INSTALLED_APPS = [
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.humanize",
"file_resubmit",
"sass_processor",
"bookwyrm",
"celery",
@ -252,7 +253,11 @@ else:
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
},
}
},
"file_resubmit": {
"BACKEND": "django.core.cache.backends.filebased.FileBasedCache",
"LOCATION": "/tmp/file_resubmit/",
},
}
SESSION_ENGINE = "django.contrib.sessions.backends.cache"

View file

@ -4,6 +4,7 @@ celery==5.2.7
colorthief==0.2.1
Django==3.2.20
django-celery-beat==2.4.0
django-file-resubmit==0.5.2
django-compressor==4.3.1
django-imagekit==4.1.0
django-model-utils==4.3.1