mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-11 09:45:27 +00:00
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:
parent
c9e6dcc2d9
commit
df43a8e2c5
3 changed files with 9 additions and 4 deletions
|
@ -3,6 +3,7 @@ from django import forms
|
||||||
|
|
||||||
from bookwyrm import models
|
from bookwyrm import models
|
||||||
from bookwyrm.models.fields import ClearableFileInputWithWarning
|
from bookwyrm.models.fields import ClearableFileInputWithWarning
|
||||||
|
from file_resubmit.admin import AdminResubmitImageWidget
|
||||||
from .custom_form import CustomForm
|
from .custom_form import CustomForm
|
||||||
from .widgets import ArrayWidget, SelectDateWidget, Select
|
from .widgets import ArrayWidget, SelectDateWidget, Select
|
||||||
|
|
||||||
|
@ -70,9 +71,7 @@ class EditionForm(CustomForm):
|
||||||
"published_date": SelectDateWidget(
|
"published_date": SelectDateWidget(
|
||||||
attrs={"aria-describedby": "desc_published_date"}
|
attrs={"aria-describedby": "desc_published_date"}
|
||||||
),
|
),
|
||||||
"cover": ClearableFileInputWithWarning(
|
"cover": AdminResubmitImageWidget(attrs={"aria-describedby": "desc_cover"}),
|
||||||
attrs={"aria-describedby": "desc_cover"}
|
|
||||||
),
|
|
||||||
"physical_format": Select(
|
"physical_format": Select(
|
||||||
attrs={"aria-describedby": "desc_physical_format"}
|
attrs={"aria-describedby": "desc_physical_format"}
|
||||||
),
|
),
|
||||||
|
|
|
@ -99,6 +99,7 @@ INSTALLED_APPS = [
|
||||||
"django.contrib.messages",
|
"django.contrib.messages",
|
||||||
"django.contrib.staticfiles",
|
"django.contrib.staticfiles",
|
||||||
"django.contrib.humanize",
|
"django.contrib.humanize",
|
||||||
|
"file_resubmit",
|
||||||
"sass_processor",
|
"sass_processor",
|
||||||
"bookwyrm",
|
"bookwyrm",
|
||||||
"celery",
|
"celery",
|
||||||
|
@ -252,7 +253,11 @@ else:
|
||||||
"OPTIONS": {
|
"OPTIONS": {
|
||||||
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
"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"
|
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
|
||||||
|
|
|
@ -4,6 +4,7 @@ celery==5.2.7
|
||||||
colorthief==0.2.1
|
colorthief==0.2.1
|
||||||
Django==3.2.20
|
Django==3.2.20
|
||||||
django-celery-beat==2.4.0
|
django-celery-beat==2.4.0
|
||||||
|
django-file-resubmit==0.5.2
|
||||||
django-compressor==4.3.1
|
django-compressor==4.3.1
|
||||||
django-imagekit==4.1.0
|
django-imagekit==4.1.0
|
||||||
django-model-utils==4.3.1
|
django-model-utils==4.3.1
|
||||||
|
|
Loading…
Reference in a new issue